According to NBCNews:
In November 2010, the Swedish government issued an international arrest warrant for Assange in connection with allegations of sexual assault and rape from two women. Assange, who has denied the allegations, surrendered to British police the following month and was released on bail — whereupon he fled, breaking the terms of his bond agreement.
Assange's lawyers have often warned that he would be handed over to U.S. prosecutors because of WikiLeaks' publication of classified documents. Rafael Correa, then the president of Ecuador, granted him asylum in 2012.
Sweden later dropped its investigation and Assange is no longer wanted there — but he remained in the embassy because London's Metropolitan Police said he would be arrested for violating his bail as soon as he stepped outside.