RIO DE JANEIRO — A Canadian sailing ship filled with high school and college students sank off the coast of Brazil in strong winds, but officials said all 64 people aboard were rescued Friday after about 16 hours in rafts tossed by rough seas.

A distress signal was picked up from the three-masted SV Concordia about 5 p.m. Thursday, Brazil’s navy said in a statement and an Air Force plane later spotted life rafts floating in the ocean about 300 miles off the coast of Rio de Janeiro.

Forty-eight students – in grades 11, 12 and university freshmen – were aboard the vessel, said Kate Knight, head of West Island College International of Lunenburg, Nova Scotia, which operates the Class Afloat program.

Edgardo Ybranez, captain of the Philippine flagged Hokuetsu Delight cargo ship, told The Associated Press via satellite phone that his ship rescued 44 of the victims in rough, dangerous seas. The remaining people were picked up by another ship.

Ybranez said the Concordia’s doctor had suffered an injury before the rescue, ”but he is OK now.”

All the rest were unhurt, Ybranez said: ”You can tell their parents that everything is OK; everybody aboard my ship is fine.”

Canadian Prime Minister Stephen Harper issued a statement thanking the Brazilian Navy and the merchant crews ”for their swift and heroic response.”

School officials said 42 of those aboard were from Canada. Knight said others are from the United States, Australia, New Zealand, Mexico, Europe and the West Indies.

”At this point we can’t confirm at all what circumstances led them to abandon ship, or the status of the vessel,” she said.

The Brazilian Navy, however, said the ship sank and Juan Cruz Margarita, captain of the SE Stao Knutsen that assisted in the rescue operation, told the AP via satellite phone he saw no sign of the Canadian ship by the time his vessel arrived.

Navy spokeswoman Maria Padilha said the students spent up to 16 hours on life boats before they were rescued between 4 a.m. and 9 a.m. She said the students would be moved to a Navy ship and taken to Rio.

Padilha said rough weather in the area had so far prevented their transfer to the Brazilian ship. Under the best conditions, she said, it would take at least 12 hours for the Navy ship to reach Rio.

Shelley Piller, whose 17-year-old stepdaughter Elysha was on board, told the AP in a telephone interview from Kenilworth, Ontario, that she was worried despite hearing news that everyone was safe.

”That’s my kid. For me I need to actually physically see her, feel her and have her in front of me to understand that she’s safe,” Piller said. ”We’re petrified, absolutely petrified.”

The ship had visited Europe and Africa since leaving Canada in September, and it had just begun a five-month semester program on leaving Recife in Brazil’s northeast on Feb. 8. It was scheduled to dock in Montevideo, Uruguay on Tuesday, then head on to several islands in the Atlantic and to southern Africa and the Caribbean before returning to Canada.

The school’s Web site says the 188-foot-long Concordia was built in 1992 and ”meets all of the international requirements for safety.” It carries up to 66 passengers and crew and can operate under motor power.

The college’s Web site says it gives high school and college students the chance to study while sailing the world. Tuition is $40,600 a year.