JAKARTA, Indonesia — Joko Widodo, the wildly popular governor of Indonesia’s capital, Jakarta, on Friday received what his supporters had been hoping to see: his party’s blessing to run for president in July.

The opposition Indonesian Democratic Party of Struggle announced on Twitter that Mr. Joko, widely known as Jokowi, would be its presidential candidate. The announcement ended more than a year of speculation over whether the party’s chairwoman, Megawati Sukarnoputri, 67, a former president, would name herself as its candidate or support Mr. Joko, who is 15 years younger.

The party posted photographs online Friday of Mrs. Megawati, accompanied by her daughter, Puan Maharani, a senior party leader and lawmaker, holding a handwritten statement declaring that Mr. Joko had been chosen to run, as well as images of “Jokowi for President” buttons.

A former small-town mayor in Central Java Province, Mr. Joko became a political phenomenon after winning the governorship of Jakarta in September 2012 as an opposition candidate. During the past year, in numerous opinion polls about presidential prospects, he has been the clear leader. But he declined to discuss any presidential aspirations, saying the decision was Mrs. Megawati’s.

As the news broke Friday afternoon, the governor, visiting Marunda along the seafront in North Jakarta, was mobbed by journalists and supporters. “Bismillah,” he told Detik.com, an Indonesian news portal, meaning, “in the name of God,” “I am ready.”

An aide to Mr. Joko, who asked not to be named, said Mrs. Megawati, who was president from 2001 to 2004, called Mr. Joko shortly before the announcement.

Mr. Joko cannot be formally nominated before national legislative elections scheduled for April 9. Political parties must win 20 percent of the seats in Indonesia’s House of Representatives to nominate a candidate, or form a coalition with other parties to reach that threshold. The Indonesian Democratic Party of Struggle is leading in credible legislative polls, and it is likely to gain momentum by announcing Mr. Joko as its presidential candidate less than four weeks before the elections.

Despite a sentimental regard in Indonesia for Mrs. Megawati, leader of the political dynasty built by her father, Sukarno, the country’s revered founding president, her prospects for regaining the presidency appeared remote. She lost her bid for re-election in 2004 and failed again in 2009.

A survey released in January by Indobarometer, an Indonesian polling firm, suggested that Mrs. Megawati would place third in the 2014 presidential contest if Mr. Joko were not a candidate, behind Prabowo Subianto, a former army general. Other polls in recent months have consistently given Mr. Joko a double-digit lead over Mr. Prabowo if he were the party’s candidate.

Continue reading the main story