QUITO, Ecuador — Ecuador announced on Thursday that it had granted citizenship to Julian Assange, the WikiLeaks co-founder who has been living in a tiny room in the South American country’s London embassy since seeking political asylum in 2012.

It was an extraordinary development in the prolonged diplomatic standoff, and came only hours after Britain said it had rejected a request by Ecuador to grant Mr. Assange diplomatic immunity so he could leave the embassy.

“Ecuador knows that the way to resolve this issue is for Julian Assange to leave the embassy to face justice,” Britain’s Foreign Office said in a statement, adding that Britain was not in talks with Ecuador about the matter.

On Wednesday, Mr. Assange hinted that something was afoot when he tweeted a picture of himself wearing a yellow Ecuadorean soccer jersey.