(CNN) The White House intervened in order to add an extra littoral combat ship to Navy's budget request a day after the budget was released, three sources familiar with the decision told CNN, in a move that has befuddled lawmakers and budget experts.

The decision to add a second littoral combat ship to the Trump administration budget after the fact caught even Navy leaders by surprise, with Navy officials delivering contradictory testimony Wednesday while defending their budget on Capitol Hill.

The Navy initially submitted a budget that funded one littoral combat ship for 2018, down from two that the Obama administration requested in 2017.

On Wednesday morning, acting Navy Secretary Sean Stackley defended the decision to fund just one such ship in a Senate hearing. But by the afternoon, Navy acquisition official Allison Stiller testified to a House panel that the White House Office of Management and Budget now "endorsed" a second ship, which would cost more than $500 million.

According to the sources, the littoral combat ship about-face was spearheaded in the White House by Rick Dearborn, a White House deputy chief of staff who is the former chief of staff to Alabama senator-turned Attorney General Jeff Sessions.

Littoral combat ships are built by Austal USA in Mobile, Alabama, and Lockheed Martin in Marinette, Wisconsin. Lawmakers from those two states have warned that cutting the LCS production would lead to devastating job losses for the shipyards, and Congress added a third littoral combat ship to the Navy's 2017 budget.

The extra littoral ship was tacked onto the budget after a lengthy back-and-forth between the Navy, the Pentagon and OMB over the program, which was among the last items decided in the Pentagon budget request.

"It was just an unorthodox process," said one of the sources. "Ultimately the decision to include two ships was made after the budget went to print so it had to be announced outside the normal budget document."

A White House spokesman referred questions about Dearborn's role to OMB. An OMB official said the LCS was added after the budget was released because "the facts and need for a second came to us so late in the process."

"Had we known about this need that far back we would have put it in the request," the official said.

Adding a second littoral combat ship includes a price tag of more than $500 million, and the Pentagon says the Navy will offset that funding elsewhere, which has not been determined yet.

"The Navy will identify the offset," said Pentagon spokesman Lt. Col. Eric Badger, adding the administration would submit a "budget errata" to add the second LCS.

The decision has turned heads on Capitol Hill, which is still awaiting a detailed explanation from the Pentagon about the move.

"I've never seen anything like it," Senate armed services chairman John McCain of Arizona told CNN.

Rep. Adam Smith of Washington, the top Democrat on the House armed services panel, was more blunt: "They pulled that ship out of their asses."

Defense budget experts said the move to change the budget roughly 24 hours after it was released was highly unusual.

"Normally the administration will spend the next several weeks defending every last detail in the budget request," said Todd Harrison, a defense analyst at the Center for Strategic and International Studies.

Congress has a history of bolstering the controversial Littoral Ship program, which the Pentagon sought to curtail to just one contractor under former Defense Secretary Ash Carter.

The Navy is currently planning to transition out of the LCS program to build frigate ships instead, but Wisconsin and Alabama lawmakers are concerned about gaps in shipbuilding during the transition to the frigate that could lead to layoffs at their shipyards.

"You just can't snap your fingers and build ships," said Sen. Richard Shelby, an Alabama Republican and senior appropriator. "You have workers, you have everything, suppliers. You've got to have skilled people."

Three weeks before the budget was released, White House budget chief Mick Mulvaney acknowledged the debate over whether to add an additional LCS in an interview with radio host Hugh Hewitt, but suggested it was a settled matter.

"The Navy doesn't want them," Mulvaney said at the time.

The odd saga for the LCS was part of a larger criticism congressional Republicans made about Trump's budget including just eight new ships — the additional littoral combat ship could make nine if another ship isn't cut in its place — arguing the administration is failing to move toward the 350-ship Navy Trump touted on the campaign trail.

The shipbuilding budget was a particular sore spot for Republicans who have slammed Trump's $603 billion defense budget request as too small to rebuild the military.

"It's still well short of where we need to be," said Virginia Republican Rep. Rob Wittman. "The problem is that the glide path to get to 355 (ships) if you're going to do that in a 20-to-25 year time frame, you can't waste a year. This is a year you have to come in, you have to do some significant things."

CORRECTION: An earlier version of this story misstated where Lockheed Martin build their littoral combat ships.