BOGOTÁ, Colombia—Ivan Duque, a 41-year-old lawyer who spent much of his working life in Washington policy circles, was handily elected president in a vote that is expected to usher in a rightward shift in a country that has been struggling as it emerges from a long guerrilla conflict.

Mr. Duque, a market-friendly senator who pledges to loosen regulations for businesses and aggressively fight the drug trade, won 10.3 million votes on Sunday, 54% of the total, with nearly all voting stations reporting. He will become the country’s...