President Trump plans a visit next month to the border wall that is at the heart of the ongoing partial government shutdown, he said Monday.

Mr. Trump announced plans for the trip to the southern border while visiting U.S. troops in Iraq. He also said he was ready to keep the federal government partially shuttered until he gets more funding for border security.

“Whatever it takes. We need a wall. We need safety for our country,” the president said. “Even from this standpoint [in Iraq]. We have terrorists coming in through the southern border.”

Mr. Trump said he would visit a part of the existing wall on the border before his State of the Union on Jan. 22.

About 25 percent of the federal government shut down Saturday when funding ran out. Mr. Trump and Senate Democrats are locked in a fight over his demand for $5 billion for border security, including a wall or barrier on the border with Mexico.

Capitol Hill Democrats fiercely oppose the border wall plan, which was one of Mr. Trump’s top campaign promises in 2016.