Defense Secretary Jim Mattis said President Trump deserves a Pentagon leader “whose views are better aligned” with the commander-in-chief's, but a search for such a person will be a lot harder after Trump’s decisions on Syria and Afghanistan.

Mattis' resignation Thursday, which will take effect in February, came shortly after Trump announced that the U.S. military will withdraw from Syria and pull back from Afghanistan.

While Mattis’ departure was considered imminent amid his opposition to the Army staff changes Trump was considering, the Syria decision ultimately pushed him to quit after he failed to convince the president to reconsider the move.

CLICK HERE TO GET THE FOX NEWS APP

A source close to the president told Fox News that Gen. Jack Keane and Sen. Tom Cotton, R-Ark., are considered the frontrunners to replace Mattis.

But neither candidate seems likely to embrace Trump’s “America First” foreign policy: Both came out against the withdrawal from Syria in strong terms. Trump's appointment of either of them could pave the way toward a repeat of the same policy disagreements the president had with Mattis.

Keane, a retired four-star Army general -- who’s also a former Army vice chief of staff -- has been suggested as a possible replacement for Mattis, even though he recently said he doesn’t “intend to go back into public service.”

His name was mentioned in October after Trump’s "60 Minutes" interview in which the president said Mattis was “sort of a Democrat” who may “leave soon.”

For Trump to nominate Keane, however, he would have to swallow Keane’s hawkish stance on international affairs and his recent criticism of the move to pull out of Syria, which the retired general called a “huge strategic mistake."

“Clearly, we're repeating the Obama mistake of premature withdrawal, which got us ISIS,” Keane said on Fox News’ “America's Newsroom” on Thursday.

"Clearly, we're repeating the Obama mistake of premature withdrawal, which got us ISIS." — Retired Army Gen. Jack Keane

“In my judgment, we need to stick to it and finish the job,” Keane added, noting that the withdrawal of American troops will give “a victory of strategic proportions” to the Iranian regime.

Keane is likely to diverge from Trump’s decision that some American troops should be pulled from Afghanistan.

Last year, after the Trump administration announced the increase in troops in Afghanistan, Keane told Fox News that there needs to be between 10,000 to 20,000 additional troops in the country to win the war.

“There's no doubt the 4,000 will be helpful,” he said of the additional troops. “But the real question is: Will it change the momentum of the war to our favor? My judgment is it’s likely not to.”

Keane also voiced his opposition to Trump’s plans to trim the planned defense budget, saying it was a mistake. He went on to slam Mick Mulvaney, Trump’s acting White House chief of staff, saying he’s “a fox in the chicken coop,” according to Politico.

Meanwhile, Cotton, who was previously considered for defense secretary or CIA director, is also on the White House radar to replace Mattis.

Yet just like Keane, Cotton is more aligned with the hawks of the defense establishment and has urged Trump to reconsider the Syria move.

He co-signed a letter with other Republican colleagues, including U.S. Sen. Lindsey Graham of South Carolina, stating their opposition to Trump’s decision.

Graham’s opposition was singled out by Trump on Thursday: The president claimed the senator was against “saving soldier lives & billions of $$$.”

In many ways, Cotton is also more interventionist than Mattis and openly suggested potentially using military force or covert action to remove the Syrian dictator Bashar al-Assad.

Cotton also warned earlier this summer that a premature withdrawal from Afghanistan could lead to negative effects on U.S. national security and to a resurgence of terrorist groups in the country.

“I wish that you and all of those other lieutenants and captains who said in 2001 that they were there -- so their kids wouldn’t have to be -- could have had that prediction come true. But it’s simply not the case,” Cotton said during a hearing concerning the next head of the NATO mission in Afghanistan.

“The enemy is still there," he added. "And the enemy still gets a vote."

Fox News’ John Roberts and the Associated Press contributed to this report.