Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The commander of the United States Pacific Fleet is retiring after learning there's no possibility of him being promoted out of his current job, he said in a statement to NBC News on Monday.

Admiral Scott Swift was in charge of the Pacific Fleet during the period this summer when two different ship crashes left 17 sailors dead.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Swift said that Chief of Naval Operations John Richardson told him that he would not be nominated for the Pacific Command post, which is senior to Pacific Fleet.

Admiral Scott Swift, commander of the U.S. Pacific Fleet, speaks to reporters during a press conference at Changi naval base in Singapore on August 22, 2017. Roslan Rahman / AFP/Getty Images file

Swift has been the head of the U.S. fleet since 2015, serving as a regional leader during the deadly crashes of the USS Fitzgerald and USS McCain in June and August, respectively.

After the McCain crashed into an oil tanker off the coast of Singapore, killing 10 sailors, the commander of the 7th Fleet, Vice Adm. Joseph Aucoin, was relieved of his post "due to a loss of confidence in his ability to command," the Navy said.

That crash came just two months after the Fitzgerald hit a merchant ship, killing seven and leading to a reshuffling of senior officers.

In a statement, he said he was retiring "with great appreciation and gratitude for the honor of having served so many Sailors and their families for what will be 40 years in January."

"Whether my timeline of remaining service is six weeks or six months," Swift added, "I will fill that time with the energy of an Ensign and the wisdom drawn from the 140,000 Sailors who report for duty every morning in the Pacific Fleet."

Swift has not yet set a retirement date.