The main thing that could derail markets and the economy would be a Democrat takeover of Congress, White House economic advisor Kevin Hassett said Thursday.

With GDP expected to grow about 4 percent in the second quarter and stocks on a hot streak in July, Hassett, chair of the Council of Economic Advisers, said politics are the main threat to the current momentum. Midterm elections are coming in November, with control of the House and Senate on the table as President Donald Trump looks to continue pushing his agenda forward.

"I could think of a lot of bad things that could hurt markets," Hassett told CNBC's Joe Kernan in a "Squawk Box" interview. "I would say the biggest bad things I could think about is we've made so much progress passing all these policies like tax reform and deregulation that have led to a surge in sentiment and a surge in economic growth."

"If politics were to change in the U.S. so that Democrats would come in and pass big tax hikes and re-regulate, that would be terrible and markets would be terrified of that," he added.

The gained 20 percent during the first year of Trump's term in 2017 and is up another 5.3 percent in 2018. GDP rose 2.3 percent last year and is projected to accelerate close to 3 percent this year. The gains come amid aggressive tax cuts, deregulation and spending increases that are part of Trump's efforts to ignite the economy after years of slow growth following the Great Recession.

Carlyle Group founder David Rubenstein, a former aide to President Jimmy Carter, acknowledged during the Delivering Alpha conference Wednesday that the economic improvements cast doubt on whether the Democrats can wrest control of Congress come November.

There have been concerns from both Democrats and Republicans that Trump's decision to play hardball with both allies and adversaries when it comes to trade might derail the economic momentum.

Hassett said he's not worried about that.

"I believe the president when he says that, yes, he's going to use the leverage that he has to make better deals," Hassett said. "I think the president is serious that if people continue to treat us unfairly, then he's going to be tough on them."