The San Diego-based USS Spruance has broken the record for the longest deployment by a destroyer since the end of World War II, a stretch that hit the 339 day mark on Sunday, according to the Navy.

Spruance surpassed the USS McFaul, which completed a 333-day mission on Oct. 23 when it returned to its homeport in Norfolk, Va.

The new record was not anticipated.

The Spruance was expected to be deployed for about seven months when it left Naval Base San Diego in November to serve as an escort ship for the USS Abraham Lincoln Carrier Strike Group. Its mission was extended when the U.S. went to war with Iran in February.

The 510-foot Spruance, with a crew of roughly 330 sailors, was one of the first American destroyers to fire missiles at Iran when the war started. The ship later helped to enforce a naval blockade in the Strait of Hormuz. And it played a key role in shielding the Lincoln from drone and missile attacks.

The carrier Lincoln left for its home base in San Diego on Aug. 20, but the Spruance did not follow. It was assigned to patrol the Indo-Pacific, partly because the Navy is struggling to build and repair enough ships to meet its needs. The Lincoln arrived at Naval Station North Island on Oct. 8.

Spruance is expected to return to San Diego in November, but an arrival date has not been announced.

The ship is named after the late Adm. Ray Spruance, who led the U.S. to victory over Japan in the Battle of Midway in 1942. Historians say Spruance’s ability to destroy four Japanese fleet carriers during that fight was a turning point in the war, helping lead Japan to surrender three years later.

Spruance cultivated his naval skills years earlier while commanding destroyers based in San Diego.