SYDNEY – Two Australian navy patrol boats rescued 162 people from an asylum seeker boat in trouble in Indonesian waters and were taking them Thursday to an immigration detention center on a remote Australian island territory.

Three people required medical attention, including a man who suffered a heart attack and was resuscitated by military personnel, Australian Maritime Safety Authority spokeswoman Jo Meehan said.

There were no fatalities, unlike recent incidents in which would-be migrants have capsized on their way to Australia.

On Tuesday, Australia and Indonesia agreed to strengthen communication during sea disasters and look into an exchange program of search and rescue specialists to combat people smuggling.

Many asylum seekers travel to Indonesia first before aiming for Australian territory in rickety, crowded fishing boats.

The rescued wooden asylum seeker boat issued a distress call by satellite phone to Australian authorities Wednesday morning and said it was taking on water, the maritime authority said.

Its initial location was 50 miles southwest of Panaitan, a small island off the western end of the main Java island. By afternoon, it had drifted within 180 miles of Christmas Island, Indonesian officials said.

The 162, believed to include Indonesian crew as well as asylum seekers, were transferred to the patrol boats late Wednesday “due to concerns about the seaworthiness of the vessel,” the maritime authority said.

The authority had initially said 164 were aboard.

The precise problem with the boat was unclear, but Australian Home Affairs Minister Jason Clare said Wednesday that the weather was “very rough.”

Australian naval officers were transporting the rescued to Christmas Island, where migrants are held in a detention center while their asylum claims are heard.

The territory is nearer to Indonesia than to the Australian mainland and is a popular destination for asylum seekers.