House Speaker Paul Ryan’s announced retirement on Wednesday exposes what appears to be an already-behind-the-scenes match between his top lieutenants to replace the chamber leader.

Ryan and his staff had for weeks denied rumors that the Wisconsin Republican planned to leave office, as House Majority Leader Kevin McCarthy and Majority Whip Steve Scalise appeared to be increasing their respective national profiles and positioning for the job.

But as signs of the shadow campaigns emerge, the Democratic party could play spoiler. If the Democrats retake the House in November, current Minority Leader Nancy Pelosi could be in an ideal position to retake power. The California congresswoman served as House Speaker from 2007-2011.

McCarthy, a California Republican, dined privately with President Donald Trump over Congress’ spring break and worked with the White House economic team on cutting some spending in the recently enacted $1.3 trillion budget bill -- as fiscal conservatives pummeled Washington Republicans over the deficit-busting bill and Ryan was overseas on official business and with family.

Scalise also has moved increasingly into the spotlight, particularly in the aftermath of the mass shooting in February at the Parkland, Fla., high school in which 17 people were killed.

The 52-year-old Louisiana Republican, himself a mass-shooting survivor, participated in Trump’s subsequent, televised White House roundtable on gun violence and met privately on Capitol Hill with some Parkland students.

“We talked about our shared experience,” said Scalise, who is still recovering from the gunshot wounds he suffered in the June 2017 mass shooting while practicing with colleagues for a charity softball game.

While Trump appears partial to McCarthy, he has also praised Scalise for his courage and example.

“With us tonight is one of the toughest people ever to serve in this House,” the president said at his State of the Union address in February, “a guy who took a bullet, almost died and was back to work three and a half months later: the legend from Louisiana, Congressman Steve Scalise.”

Still, while Trump seems more closely aligned with McCarthy, 53, he will not be the only deciding factor in who will next lead the House Republican Caucus -- regardless of whether Democrats become the chamber’s majority party after the 2018 midterms.

Pelosi would face hurdles as well. Democrat Conor Lamb, who won Pennsylvania’s 18th District special election in March, said repeatedly during his campaign that he would not support Pelosi retaking the speaker's gavel. Others in the party have suggested it's time for a new leader.

However, no other Democrats have built serious momentum to take on Pelosi as of yet.

While McCarthy and Scalise appear to be frontrunners in the GOP, each has made political missteps that have set back their respective careers.

In 2015, McCarthy suggested on cable TV that Republican leaders of the GOP-controlled House established the Benghazi, Libya, special committee to effectively damage Democrat Hillary Clinton’s 2016 presidential campaign, then promptly ended his bid to replace House Speaker John Boehner, despite what appeared to be the support of the majority of his caucus.

“Everybody thought Hillary Clinton was unbeatable, right?,” he told Fox News’ Sean Hannity in Fall 2015. "What are her numbers today?”

Scalise was elected to Congress in 2008 and won a close internal race in June 2014 to become the majority whip, the caucus’ No. 3 post.

However, six months later, Scalise, pressed by Washington Democrats and other critics, acknowledged that roughly 12 years earlier he might have spoken at a white supremacist conference led by former Ku Klux Klan leader David Duke.

“I didn’t know who all of these groups were and I detest any kind of hate group,” he said at the time.

Scalise and McCarthy, the No. 2 House Republican, denied interest in the speakership as speculation mounted in recent weeks about Ryan leaving Congress after roughly two decades.

But on Wednesday, within hours of Ryan saying he won’t seek re-election in November and will retire in January, each faced renewed questions.

“I’ve been interested in moving up,” Scalise told Fox News. However, he was mum on whether he’s being encouraged to compete for the speakership, saying, “People are still processing what happened” with Ryan.

Said McCarthy, “The only focus I have is on the work I have to get done.”

Other names mentioned in recent weeks regarding who would replace Ryan include North Carolina GOP Reps. Mark Meadows and Patrick McHenry.

Meadows is the leader of the House Freedom Caucus, the chamber’s most influential conservative wing with roughly 35 members, and McHenry, Scalise’s deputy whip.

A leader of the Tea Party movement last week played down notions that somebody from the chamber’s conservative wing, which didn’t support McCarthy’s earlier bid, could lead, after working under the more establishment Boehner, then Ryan, saying the outcome of this year’s elections will be a major, deciding factor.

Fox News’ Mike Arroyo, Anne Ball and Chad Pergram contributed to this report.