JACKSON, Miss. — The final chapter of the 2018 midterms is nearing a close in Mississippi, where the prevalent themes of President Donald Trump and race have combined for a much closer contest than anyone expected in one of the country’s most deeply conservative states.

Republican Sen. Cindy Hyde-Smith, appointed to the seat in April, gives unwavering support to the president who will campaign for her at two rallies on Monday, a day ahead of the runoff. Trump also has thanked her right back on Twitter for voting for “our Agenda in the Senate 100% of the time.”

She is up against Democrat Mike Espy, a former congressman and U.S. agriculture secretary who is seeking to become Mississippi’s first black senator since Reconstruction. And in the final weeks of the campaign, race has become a dominant issue.

This is the last U.S. Senate race to be decided in 2018 and will determine whether Republicans pad their slim majority.

Hyde-Smith has drawn fire for attending a white private school that was founded after court-ordered school desegregation of public schools. She’s been seen in a photo wearing a replica hat of a Confederate soldier and in a video praising a supporter by saying, “If he invited me to a public hanging, I’d be on the front row.”

Mississippi has a history of racially motivated lynchings and violence against people who sought voting rights for black citizens. Some 38 percent of the state’s residents are black, and Espy is trying to boost their turnout and pick up support from white voters who are uneasy with Trump or the racially tinged stories about Hyde-Smith.

The winner Tuesday finishes the final two years of a term started by Republican Sen. Thad Cochran. He resigned in April amid health concerns.

It’s the last U.S. Senate race to be decided in 2018 and will determine whether Republicans pad their slim majority.

Hyde-Smith’s support of Trump is unmistakable. She used both her opening and closing statements of the only debate of the runoff campaign to promote Monday’s presidential rallies, citing the online address to get tickets. Even on trade and tariffs, where Trump’s decisions could hurt Mississippi farmers, Hyde-Smith praised the president.

“I have met with the president, and I proudly support him in negotiating these trades,” she said. “All the Mississippi farmers want is a fair deal, and I’m excited that the president has stepped up to renegotiate these deals.”

Hyde-Smith and Trump are set to appear together at a late Monday afternoon event in the northeastern city of Tupelo, best known as the birthplace of Elvis Presley. Then, they fly to the Gulf Coast for a larger evening rally in Biloxi.

Democrats also have used some star power. Former Vice President Joe Biden has endorsed Espy, and three Democrats who could run for president in 2020 — Sens. Kamala Harris of California and Cory Booker of New Jersey and former Massachusetts Gov. Deval Patrick — have been to Mississippi to campaign for the former congressman who served as agriculture secretary in 1993 and 1994 under Democratic President Bill Clinton.

For Espy, turnout is key. He has to close the gap in a state where Trump received 58 percent in 2016 and that hasn’t elected a Democrat to the U.S. Senate since 1982.

About a third of Mississippi voters were African-American in the four-way race on Election Day, and Espy won support from about 80 percent of them, compared to about 20 percent of white voters, according to VoteCast, a wide-ranging survey of the electorate conducted by The Associated Press.

If Espy’s campaign can boost African-American turnout to 40 percent and he can win 9 out of 10 of their votes, he would only need less than a quarter of white votes to secure a victory.

Espy hasn’t hammered Hyde-Smith on Trump at every turn. His campaign has focused more on issues such as social justice, health care and raising wages.

“My approach is Mississippi first,” Espy said at last week’s debate. “That means that Mississippi over party, Mississippi over person — I don’t care how powerful that person might be.”

Espy also has carefully picked his time to talk about race. He does remind voters while Hyde-Smith was in a white academy, he and his twin sister were being called racial slurs while integrating Yazoo City High School in 1969.

Hyde-Smith has apologized to “anyone that was offended” by the hanging comment, saying she meant no ill will. She and her campaign have refused to talk about the Confederate hat and have called the school issue a personal attack on her family meant to draw attention away from issues.

Walmart asked Hyde-Smith to return a $2,000 campaign contribution because of the hanging remark.

READ MORE: Walmart requests campaign refund from Sen. Hyde-Smith after ‘hanging’ remark