BOSTON (AP) – The third time was a charm for the USS John F. Kennedy, which left Boston Harbor Wednesday afternoon after being delayed twice, the Coast Guard said.

The aircraft carrier’s farewell visit to President Kennedy’s home state was scheduled to end on Sunday. But Navy officials elected to stay an extra day for refueling, and on Tuesday high winds pushed the warship into the pier, making it dangerous to leave.

Eventually the ship will travel to Mayport, Fla., where it will be decommissioned later this month.

The 40-year-old ship, one of just two fossil fuel-powered aircraft carriers remaining in the Navy, was visited by about 51,000 people over the weekend. So many people visited Saturday that Navy officials shut down the mile-long line in the morning, saying there wasn’t enough time to get everyone through security.

The Kennedy, with a crew of about 4,600, is more than 1,050 feet long, and can carry 70 combat aircraft.

It was christened in May 1967 by the president’s then 9-year-old daughter, Caroline, and entered Navy service in September 1968. It was deployed to support both wars in Iraq and the war in Afghanistan.

AP-ES-03-07-07 1723EST