The man who stands most to benefit from Pedro Pablo Kuczynski's presidential victory in Peru may be his defeated rival's father: imprisoned ex-President Alberto Fujimori.

Kuczynski began the task of forming a government Friday after his rival Keiko Fujimori conceded defeat in Peru's closest presidential contest in five decades. His margin of victory was less than 43,000 votes — or 0.2 percentage points.

Even more challenging is his position in congress, where Fujimori's party, smarting after a bitter campaign, holds 73 of 130 seats and his own bloc has just 18.

Analysts say his best chance to ease hostility could be in releasing Alberto Fujimori to house arrest, freeing him from the prison where he is serving a 25-year sentence for corruption and supporting death squads during his autocratic rule in the 1990s.

During the campaign, Keiko Fujimori signed a pledge never to issue a pardon — a move intended to mitigate fears her father would be pulling the strings in her government. Kuczynski may be more flexible.

In first interview as President-elect, he reiterated that he opposes pardoning Fujimori, but would sign legislation giving older inmates including the 77-year-old Fujimori the right to house arrest.

Still, he said he had doubts whether Fujimori's Popular Force party would push for such an outcome because many hardliner loyalists would consider it a political defeat.

"They want him to walk out the front door, but there was a conviction," Kuczynski told Semana Economica magazine.

Kuczynski's rise to power was in many ways accidental. The businessman had shown few political instincts and in February his poll numbers were sinking him deeper into a crowded field. But he began rising as two stronger candidates were disqualified on technicalities and fears grew that Fujimori would bring back the corruption and criminality associated with her father's rule.

Now that he's won, he must take reins one of South America's most ungovernable countries, one awash in illegal proceeds from cocaine trafficking and where social tensions stoked by multinational mining projects frequently erupt into deadly unrest.

At 77, Kuczynski will be Peru's oldest president when he is sworn in July 28 and, as a former Wall Street investor who has spent much of his life in the U.S., he has a notable lack of appeal among the country's poor. TV comedians love to ridicule his "gringo" accented Spanish.

The campaign left a bitter residue in part because Kuczynski accused his rival of being the harbinger of a "narco-state" after it was leaked to the media that the U.S. Drug Enforcement Administration was investigating a major donor and secretary general of her party for money laundering. In conceding, Fujimori blasted politicians, business leaders and members of the media for orchestrating a "hate-filled" campaign to discredit her candidacy.

Still, there are reasons why the two could find common ground on many policies. Kuczynski supported the younger Fujimori in the 2011 runoff won by President Ollanta Humala, both share a pro-business agenda and about a third of her lawmakers are newcomers who could be ripe for switching loyalties in Peru's notoriously free-wheeling congress.

If she proves obstructionist, Kuczynski can also call congressional elections — an option he already said he'd be willing to use as a last resort.

Harder to appease may be Peru's left, which is feeling emboldened after delivering, albeit begrudgingly, the votes Kuczynski needed to erase a nearly 20-point lead for Fujimori following the first round of voting.

Leftist activists staged the biggest street demonstration Peru has seen in a generation on the eve of voting to reject a return of a Fujimori to the presidential palace.

Failure to take them into account "would be a total betrayal of the people who got him over the hump," said Steve Levitsky, a Harvard University political scientist who has spent two decades studying Peru. "He will pay a cost. There will be marches."

___

Goodman reported from Bogota, Colombia.

Joshua Goodman is on Twitter: https://twitter.com/apjoshgoodman His work can be found at http://bigstory.ap.org/journalist/joshua-goodman

Franklin Briceno on Twitter at https://twitter.com/franklinbriceno His work can be found at: http://bigstory.ap.org/author/franklin-briceno