The longest-serving Republican in the Iowa legislature announced that he would become a Democrat, warning that his party of many decades would soon pay “a heavy price” for its support of President Trump.

The lawmaker, Representative Andy McKean, served a combined 24 years in the Iowa House and Senate between 1979 and 2003 and then returned to the legislature in 2017. At a news conference on Tuesday, he said he could not support Mr. Trump moving forward, in part because he found the president’s spending to be “reckless,” his foreign policy “erratic” and “destabilizing” and his disregard for the environment concerning.

He also attacked Mr. Trump’s demeanor, saying that he sets a poor example by insulting and bullying those he disagrees with and ridiculing and marginalizing people based on their appearance and ethnicity.

“I believe that his actions have coarsened political discourse, have resulted in unprecedented divisiveness and have created an atmosphere that is a breeding ground for hateful rhetoric and actions,” Mr. McKean said. “Some would excuse this behavior as ‘telling it like it is’ and the new normal. If this is the new normal, I want no part of it.”