In this May 29, 2018, file photo, President Trump listens as Rep. Marsha Blackburn, R-Tenn., speaks at a rally in Nashville. Blackburn and former governor Phil Bredesen, a Democrat, faced only nominal primary opposition in their race to replace retiring Republican Sen. Bob Corker. (Mark Humphrey/AP)

Republicans braced for a difficult, high-stakes campaign in the heart of Trump country as Tennessee Democrats nominated a popular former governor to run for the state’s open Senate seat.

Phil Bredesen won the Democratic nomination Thursday, giving his party its best chance of a statewide general election victory in more than a decade. He has presented himself as an affable centrist willing to work with President Trump, and his presence on the ballot forces the GOP to play defense on its home turf as the party seeks to preserve a narrow 51-to-49 Senate majority.

Rep. Marsha Blackburn, who is backed by Trump and has largely championed his agenda, won the Republican nomination.

The fall campaign will test the enduring appeal of Trump’s brand of politics in a state that he won handily two years ago but historically has been dominated by more traditional Republicans such as Sen. Bob Corker, an outspoken critic of the president whose retirement opened up the seat. Republicans, who have sought to focus on ousting vulnerable Democrats in pro-Trump states, have grown increasingly worried about a Tennessee letdown.

“We’ve just turned into a country where everybody stands on opposite sides of the room and shouts at each other,” Bredesen, 74, said in a brief victory speech streamed live on Facebook. “I’d like to be part of the fix for that.”

Blackburn and her allies plan to try to pierce Bredesen’s bipartisan image by highlighting his past support of Hillary Clinton and other national Democrats.

This week, Blackburn, 66, signaled that she intends to soften her image, issuing a TV ad on the eve of the primary that featured family photos — and no mention of Trump. But in her victory speech Thursday night, she said Tennesseans want a candidate who stands with the president, “to finish the agenda that they voted for when they elected him.”

Some Republicans expressed anxiety about the coming fight.

“The only reason Democrats have a shot in Tennessee is Bredesen himself,” said Steven Law, the president of American Crossroads, a conservative group. “Voters fondly remember his tenure as governor and he’s proven himself to be a nimble and affable politician.”

Tennessee voters also picked nominees for governor on Thursday. Business executive Bill Lee topped five competitors to win the Republican nomination. They included Rep. Diane Black, who became the fifth House Republican seeking higher office to lose in a primary this year.

Karl Dean, a former Nashville mayor, won the Democratic gubernatorial primary.

In Black’s district, which stretches to the north and east of Nashville and leans heavily Republican, the GOP nominee will be former state agriculture commissioner John Rose. Rose broadcast ads showing him smiling behind the president at a rally.

The Senate contest will be the most closely watched in November.

Republicans are anxiously confronting the prospect that they have lurched too far to the right for the state’s moderate voters, whom Bredesen is courting with a campaign carefully designed to appeal across party lines.

“It’s a very conservative state with a history of sending conservatives — but who tend to be reasonable — to state offices, whether it’s governor or Senate. And they tend to traditionally reject radicalism,” said Tom Ingram, a longtime friend and former political strategist for Corker.

Limited public polling has shown Bredesen, who served as governor from 2003 to 2011, leading Blackburn.

“I think Marsha’s race is one of the closest Senate contests in the country,” said Dan Eberhart, an oil industry executive who is raising money for several GOP Senate candidates, including Blackburn. “Bredesen is popular and has the money to run a strong campaign.”

Bredesen’s status as a brand-name politician, coupled with limited familiarity with Blackburn outside her congressional district, which extends from the Nashville area to the south and west toward the Memphis region, presents a challenge, Republicans said.

Jack Young, a Republican city council member and former mayor of Bristol, on the northeastern edge of the state, said that Republicans he has spoken with at coffee shops and local GOP meetings have expressed concern about whether Blackburn will win and are eager to help her.

But they haven’t seen much about her, Young said, a factor he attributed to the competitive governor’s primary absorbing most of the attention. They ask, “Hey, what’s going on with this?” he said of the Senate race. “I want to see more.”

Bredesen, who is personally wealthy, has hit the airwaves with television ads meant to endear him to centrist Republicans and Democrats. He has distanced himself from national Democrats, including Senate Minority Leader Charles E. Schumer (D-N.Y.), and declares that he is “not running against Donald Trump.”

“There are only so many people who are able to rise above some of the political back and forth, and he’s just one of those rare people who can do that,” said state House Democratic Caucus Chairman Mike Stewart.

In one ad, Bredesen said he will work with the president where they agree but stand against him when his agenda hurts Tennessee. He singled out Trump’s proposed tariffs as harmful to the state’s automobile, farming and whiskey industries.

Blackburn, who has been in the House since 2003 and was a state legislator before that, has mostly embraced Trump. She campaigned with him at a May rally in Nashville and emphasized her ties to him during the primary.

One top Senate GOP strategist, who spoke on the condition of anonymity to candidly discuss strategy, said that Blackburn needs to make the race a choice between someone who will enthusiastically support Trump’s agenda and someone who will constantly be torn between Trump and his Democratic bosses in Washington.

Bredesen was the last Democrat to win statewide in Tennessee. He finished on top in all 95 counties in the state in a dominant 2006 reelection showing.

The last Democrat to be elected to the Senate in Tennessee was Al Gore, who last won reelection in 1990, but then lost his home state in his failed 2000 presidential bid.

State officials in both parties said they have observed Tennessee become more conservative since Bredesen’s tenure. Trump won by 26 points in 2016. Republicans hold seven of the nine U.S. House seats and supermajorities in the state assembly.

But there is some belief in both parties that there is an appetite for the more pragmatic, less hostile style of politician embodied by Corker and the state’s other Republican senator, Lamar Alexander.

Corker, who has been one of the Republican Party’s most outspoken Trump critics, was slow to embrace Blackburn. His early praise of Bredesen and lukewarm posture toward Blackburn enraged her supporters and earned him a private warning from Senate Majority Leader Mitch McConnell (R-Ky.).

Tennessee is one of only a handful of states that Democrats believe they can flip from red to blue in the battle for the Senate. On the whole, they are playing much more defense than Republicans, including trying to safeguard 10 incumbents in states that Trump won.

Democratic strategists generally agree that any path to seizing the majority runs through Tennessee. Senate Majority PAC, the top Democratic super PAC, announced this week that the state was part of a $17 million investment to reserve time for television ads in six battleground races during August.

National Republican leaders agree about the importance of Tennessee. McConnell named the state as one of nine that he believes will decide Senate control, in a May interview with The Washington Post.

In the Senate contest, Democrats think they will need to perform well in suburban areas, which have shown the party promise in recent special elections elsewhere throughout the country.

They will need Republicans statewide to cross over. Already, they have grown confident that is happening.

“You just meet a lot of people who are Republicans but say quietly, ‘I am going to vote for Bredesen,’ ” said Stewart, the state House Democratic Caucus chairman. “They treat it like an obvious proposition.”

David Weigel contributed to this report.