LONDON — After months of posting troves of classified American documents on the Internet, Julian Assange, founder of the WikiLeaks Web site, surrendered to British authorities and was jailed on Tuesday after a judge reviewing a Swedish extradition request found him to be a flight risk and denied him bail.

For Mr. Assange and his supporters, as well as for those who have condemned him for the brazen leak of American secrets, there was a bizarre twist in the fast-moving events at a London courthouse. Instead of being arrested for punching a gaping hole in the secret worlds of American military and diplomatic power, an outcome he has long predicted, Mr. Assange, a 39-year-old Australian, found himself ensnared in allegations stemming from brief sexual encounters this summer with two young Swedish women.

What lies ahead, beyond a new court appearance on Dec. 14, when Mr. Assange’s bail bid will be renewed, is a legal battle that could last weeks, or much longer.

That contest will focus on whether the Swedish request for Mr. Assange’s extradition to face questioning on charges of “rape, sexual molestation and unlawful coercion” is unrelated to WikiLeaks, as Swedish prosecutors and the women themselves say — or whether they are linked, in what Mr. Assange has called a smear campaign to punish him for his WikiLeaks activity.