Swedish prosecutors heading the probe into a rape allegation against Julian Assange issued a formal detention order Monday against the WikiLeaks founder, who is jailed in Britain — a first step in seeking his extradition.

Eva-Marie Persson, Sweden’s deputy director of public prosecutions, said she had filed the request with the Uppsala district court to have Assange detained in absentia.

“If the court decides to detain him, I will issue a European Arrest Warrant concerning surrender to Sweden,” Persson said in a statement.

She added that once the court had granted the request, which comes after last week’s reopening of a 2010 rape probe, she would ask British authorities to transfer the Australian whistleblower to Sweden.

The development also sets up a possible showdown between Sweden and the US over who gets to try Assange first. He faces a US extradition warrant for allegedly conspiring to hack into a Pentagon computer.

Persson said British officials will decide any conflict between a European arrest warrant and a US extradition request for Assange, who was evicted last month from the Ecuadorian Embassy in London, where he had been holed up with political asylum since 2012.

He was immediately collared by British police on April 11 and is serving a 50-week sentence in Britain for jumping bail in 2012.

On May 13, Swedish prosecutors reopened a preliminary probe against Assange, who visited Sweden in 2010, after two Swedish women alleged that he had committed sex crimes against them.

While a case of alleged sexual misconduct against the 47-year-old in Sweden was dropped in 2017 when the statute of limitations expired, a rape allegation remains.

Swedish authorities have had to shelve it because he was living at the embassy at the time and there was no prospect of hauling him to Sweden.

The statute of limitations in the rape case expires in August 2020. Assange has denied wrongdoing, claiming the allegations were politically motivated and that the sex was consensual.

According to the request for a detention order, Assange is wanted for “intentionally having carried out an intercourse” with an unnamed woman “by unduly exploiting that she was in a helpless state because of sleep.”

The request added there was “an aggravating circumstance” because he didn’t use a condom.

Assange met the two Swedish women in connection with a lecture in August 2010 in Stockholm.

One was involved in organizing an event for Sweden’s Social Democratic Party and offered to host him at her home. The other was in the audience.

A cop who heard the women’s accounts decided there was reason to suspect they were victims of sex crimes and handed the case to a prosecutor.

Assange faces a maximum of four years in a Swedish prison if he is convicted of the rape.

Persson said the day and time for the detention hearing at the Uppsala District Court that will make the decision has not yet been decided.

“However, in my view, the Swedish case can proceed concurrently with the proceedings in the UK,” Persson said in a statement.

With Post wires