Republican congressional candidate Brian Mast has moved ahead of Democrat Randy Perkins in the nationally watched race for the Palm Beach-Treasure Coast District 18 U.S. House seat, according to Mast’s pollster.

Mast has a 47-to-40 percent lead over Perkins in a poll of 400 likely voters with a 4.9 percent margin of error conducted last Tuesday through Thursday by Republican pollster Jim McLaughlin for Mast’s campaign. No-party candidate Carla Spalding gets 6 percent in the poll, with 7 percent of voters undecided.

Republican Brian Mast’s pollster says his numbers have improved since he began running positive TV ads like this one.

Mast’s standing has improved since a McLaughlin poll conducted Sept. 12-14 showed Perkins with a 41-to-40 percent lead — a virtual tie considering that poll also had a 4.9 percent margin of error. The September poll was taken just before Mast began airing his first general election TV spots.

While Mast has improved, Republican presidential nominee Donald Trump is sinking in District 18, which Republican Mitt Romney carried in 2012. Trump led Hillary Clinton by a 46-to-40 margin in the September poll of District 18 voters; Clinton now has a 46-to-44 percent edge — a swing of 8 points.

District 18 is now represented by Rep. Patrick Murphy, D-Jupiter, who is leaving the seat to challenge Republican Sen. Marco Rubio. Rubio holds a slender 48-to-45 percent lead over Murphy in Murphy’s home district, according to the McLaughlin poll.

Mast’s campaign over the past month has been running positive ads emphasizing his military service, which included losing his legs after a bomb blast in Afghanistan in 2010. While Mast’s ads have been positive, outside groups have run ads attacking Perkins.

Democrat Randy Perkins in one of his campaign ads.

Perkins’ unfavorable ratings have increased from 11 percent in the September poll to 28 percent in the new survey, according to McLaughlin’s polling memo. Perkins is viewed favorably by 32 percent of voters, the memo says.

Mast’s favorable and unfavorable ratings are not mentioned in McLaughlin’s memo. Perkins has aired ads attacking Mast as a conservative in the mold of former U.S. Rep. Allen West and radio host Mark Levin, who are both known for a fiery brand of conservatism that District 18 voters rejected in 2012 when West was ousted by Murphy.

Perkins put $5.8 million of his own money into his campaign through Sept. 30, according to an Federal Election Commission report filed Saturday. Mast has raised more than $2 million and spent more than $1.6 million, with the National Republican Congressional Committee adding $1.9 million and the Conservative Leadership Fund spending $1.8 million to boost Mast.

Republicans had a 38.1-to-34.6 percent registration edge over Democrats in District 18 as of the Aug. 30 primaries. In addition to favoring Democrat Murphy and Republican Romney in 2012, District 18 confirmed its swing district reputation in 2014 when voters re-elected Murphy by 19.6 points despite big GOP gains nationwide.