President Donald Trump is leading Democratic nominee Joe Biden in Texas, but there is a close race between the two candidates in Ohio, according to two Quinnipiac University polls released Thursday.

In Texas, Trump has a 5-point edge over Biden, 50% to 45%. The polls show that 4% of Texas voters are undecided. The Texas poll surveyed 1,078 likely voters, with a 3-point margin of error.

"It is close but leaning toward Trump in Texas. There are still a slim number of likely voters who are undecided or on the fence about their choice, which could leave just enough wiggle room for either candidate to take Texas' many electoral votes," Quinnipiac University Polling Analyst Tim Malloy said.

Texas has 38 electoral votes and is considered a must-win for Trump. In 2016, Trump beat Democratic candidate Hillary Clinton by over 9 points in Texas, 52.2% to 43.2%.

Texas had previously been considered a solid red state but demographic shifts have changed the political landscape. The Cook Political Report rates Texas as “lean Republican.”

A Quinnipiac University poll in mid-July had Biden leading Trump in Texas, 45%-44%. However, six recent polls show Trump with a lead of at least 2 points, according to poll aggregator Real Clear Politics.

In Ohio, Biden has a slim 1-point lead over Trump, 48% to 47%, with 4% undecided. The poll surveyed 1,085 likely voters, with a 3-point margin of error.

"With six weeks to go until Election Day and most minds made up, Ohio could hinge on a sliver of likely voters who signal they may have a change of heart and the four percent who say they are unsure right now who they'll back. At this point, it's a toss-up," Quinnipiac University Polling Analyst Mary Snow said.

In 2016, Trump convincingly defeated Clinton in Ohio, 51.6% to 43.5%. In 2008 and 2012, Democrat Barack Obama won Ohio by a solid margin. The Cook Political Report rates Ohio, which has 18 electoral votes, as “lean Republican.”

Recent general election polls show Biden with a strong nationwide lead over Trump. A recent Economist/YouGov poll shows Biden leading Trump by 7 points nationwide, 49% to 42%.