After losing two statewide races in Florida and changing his party affiliation twice, former Gov. Charlie Crist announced Tuesday that he was running for Congress in a recently redrawn district, but he may face a stiff challenge from a former mayor of St. Petersburg.

Mr. Crist, now a Democrat, is running in a district that is expected to lean Democratic and include all of St. Petersburg, though its final shape has not been determined. But former Mayor Rick Baker, a Republican who has a record of winning support from Democratic voters, told The Tampa Bay Times that he was considering getting into the race, too.

Mr. Crist was a Republican when he was the state’s attorney general and then governor from 2007 to 2011. But when he began a 2010 run for the United States Senate, he was derided by fellow Republicans as too close to President Obama, and it appeared that he would lose the primary to Marco Rubio. Mr. Crist left the party and ran instead as an independent, losing badly in the general election. In 2014, running as a Democrat to reclaim the governor’s office, Mr. Crist lost by just 1 percent of the vote to Rick Scott, a Republican.