The U.S. Navy rescued more than a dozen Iranian sailors who had been held at sea by a band of pirates for weeks, the Pentagon announced today.

According to the military's account, an American helicopter from the destroyer USS Kidd "detected a suspected pirate skiff alongside" an Iranian-flagged fishing ship in the Arabian Sea approximately 175 miles southeast of Muscat, Oman, Thursday. At the same time, the Iranian ship was able to send a distress call, claiming the ship was held by pirates.

American Navy sailors with a "visit, board, search and seizure team" then boarded the Iranian ship and were able to detain 15 suspected pirates and free the 13-member Iranian crew, the Pentagon said. A Navy Criminal Investigative Service agent on the scene, Josh Schminky, said the Iranian crew had been forced to help the pirates carry out operations and pirates had apparently been using the Iranian ship as a "mothership".

"When we boarded, we gave [the Iranians] food, water, and medical care," Schminky said in a Pentagon report. "They had been through a lot. We went out of our way to treat the fishing crew with kindness and respect."

Rear Admiral Craig Faller, commander of the nearby USS John C. Stennis, told ABC News the Iranians knew their rescuers were Americans and were "ecstatic" and "overjoyed" to be freed.

After feeding the Iranians, the Americans left them to go on their way, but not before leaving some souvenirs: American USS Kidd baseball caps. Faller told reporters the Iranian crew waved goodbye wearing the caps with big smiles.

The pirates were detained and were taken aboard the Stennis, an aircraft carrier at the center of a six-ship strike group in the region. A Pentagon spokesperson said it was unclear if the Iranian government was aware of the incident.

The rescue comes in the midst of an especially tense time between the U.S. and Iran. Last week, the Iranian navy carried out a major exercise in the Persian Gulf that reportedly included missile tests and surveillance of U.S. vessels in the area. An Iranian military commander then warned the U.S. on Tuesday not to send U.S. warships -- including the Stennis Strike Group -- back into the Persian Gulf following the Stennis' trip out of the Gulf to assist operations in Afghanistan.

"We are not used to repeating our warnings and we issue warnings only once," Iranian Army Commander Major General Ataollah Salehi said Tuesday, according to Iran's Fars News Agency.

Iranian officials also threatened to close the Strait of Hormuz in response to a new round of U.S. economic sanctions against Iran. The Strait of Hormuz, a narrow gap that links the Persian Gulf with the Indian Ocean, is the world's "most important oil chokepoint" due to the amount of Middle East oil that flows through it daily, according to the U.S. Energy Information Administration.

The Obama administration, however, dismissed the threats.

"It's the latest round of Iranian threats and is confirmation that Tehran is under increasing pressure for its continued failure to live up to its international obligations," White House press secretary Jay Carney said the same day as Salehi's comments.

Today, another Iranian military commander reportedly announced Iran planned to hold more naval exercises in the Strait of Hormuz next month.