DAVOS, Switzerland — President Trump said on Wednesday that he would prefer a long impeachment trial with witness testimony before the Senate, but that national security concerns made that impossible, and added that he would like to attend the trial.

Mr. Trump unleashed on Democrats and the news media in a wide-ranging news conference before leaving Davos, where he met with business and government leaders from around the world, to return to Washington, where impeachment overshadows all else.

A day earlier, Mr. Trump managed to stick to a script about a strong United States economy while addressing a global audience at the World Economic Forum, and he largely swatted away any questions about the impeachment proceedings. But before leaving Switzerland, he called a last-minute news conference, during which he vented at length about his political enemies in Washington as some of his top economic advisers stood silently behind him.

Mr. Trump called Representative Jerry Nadler of New York a “sleaze bag” and referred to Representative Adam Schiff, the chairman of the House Intelligence Committee, as a “con job” and a “corrupt politician.”