Nancy Pelosi is expected to become the next speaker of the House if Democrats regain the majority, but she might face a challenge from a familiar adversary.

Rep. Tim Ryan, D-Ohio, who lost to Pelosi when he challenged her to be the House minority leader, is open to the idea of vying to lead Democrats in the lower chamber of Congress, an aide told CNBC.

"No decisions have been made regarding leadership, but Rep. Ryan has left the door open on the matter. Any decision would come after tomorrow's election results," Michael Zetts, Ryan's communications director, said Monday.

Pelosi, the California Democrat who was the first female speaker of the House, has made it clear on the campaign trail that she has been focused on helping Democrats regain the majority in the House. However, she's confident she will become the next House leader if Democrats take over Congress.

"It is up to them to make that decision, but I feel pretty comfortable where I am," Pelosi said this year at a CNN political forum when asked if she will be the next speaker.

Pelosi previously was speaker from January 2007 until January 2011.

Democrats need to flip 23 seats to win a majority. Experts give the party good odds to overtake the GOP. As of Monday, data analyst Nate Silver's FiveThirtyEight gives Democrats an 87 percent chance of retaking the House.

A senior Democratic aide close to Pelosi, who asked not to be named, blasted the notion that Ryan might try to challenge the California Democrat, suggesting that the Ohio lawmaker is trying to position himself for a presidential run in 2020.

"Tim Ryan has done nothing but exploit his criticism of Nancy Pelosi to get himself on TV and prepare for a presidential run," the aide said. "He has done absolutely nothing to distinguish himself since he last lost to Pelosi. Pelosi has tirelessly traveled the country and raised half of the record DCCC haul. Ryan is a shameless self-promoter and actively undermined Democratic unity going in the election. It's unlikely Ryan will jump in because a lamb who has been slaughtered twice by Pelosi isn't a terribly effective presidential campaign platform from which to spring from."

Ryan, who's consistently governed as a moderate Democrat, has said publicly that he's also considering running on the Democratic ticket for president in 2020.

A spokesman for Pelosi did not return requests for comment.

Ryan once competed against Pelosi for a leadership post. After President Donald Trump won in 2016 and the GOP held onto the House, Ryan challenged Pelosi for the title of House minority leader. Ryan lost, but he still managed to garner 63 votes compared with Pelosi's 134.

Other Democrats have made it a point to say they don't support Pelosi for a leadership role. According to an NBC News survey taken in August, at least 50 Democrats running for House seats said they would not back Pelosi for speaker. Many of those candidates opposing her called on Pelosi to step aside and argued it was time for new leadership.

Those close to the minority leader, though, scoff at the idea of Pelosi not receiving enough votes to lead the party if the Democrats make inroads in the House. They point to her get-out-the-vote efforts and the impact she's had raising money for Democratic election committees, including the Democratic Congressional Campaign Committee, or the DCCC.

"She's been cold, calculated and the Democrats most important weapon in combating Republicans trying to keep their majority. She's been running on three things: messaging, money and mobility," said a close Pelosi advisor who declined to be named. "There's not a single member of the Democratic congressional leadership who has even come close to what Pelosi has done throughout the year. With that being said, no one within her party will have the courage to take her on if they pull off a victory on Tuesday."

In October, Pelosi's office announced that she had raised $34.2 million for Democrats during the third quarter. That total includes $30.5 million directly for the DCCC. For the 2018 cycle, Pelosi raised $121.7 million for Democrats and since entering leadership ranks in 2002, she's raked in $714.5 million for her party.

In the past week, her extensive work on the campaign trail has led her to tell donors and advisors that she's confident Democrats will gain at least 30 seats in the House.

Nonpartisan elections analysis site Sabato's Crystal Ball also expects Democrats to pick up more than 30 seats in the House.