WASHINGTON—The House passed a resolution almost entirely along party lines to initiate the public phase of an inquiry into President Trump’s dealings with Ukraine, setting a blueprint for the fourth presidential impeachment investigation in U.S. history.

The 232-196 vote underscored the sharp partisan divide in Washington over impeachment. All Democrats but two supported the measure while all Republicans rejected it. The House’s one independent, Rep. Justin Amash of Michigan, voted yes.

Though...