Conservative former Senator Mario Abdo Benítez has been elected president of Paraguay.
The result means the right-wing Colorado Party, which has dominated Paraguayan politics for decades, will maintain its hold on power.
Mr Abdo Benítez, 46, has promised to retain low tax policies and boost agricultural exports..
With almost all of the ballots counted, he had won 46.46% of the vote compared to 42.73% for Mr Alegre.
"My administration will be committed to gaining the confidence of those who did not accompany us," he said in his acceptance speech on Sunday night.
"[We] welcome those who want to build a just homeland, a homeland with equity, a homeland with moral, strong, independent institutions."
Mr Alegre has not yet conceded victory, but he told reporters that he "respects" the preliminary results.