Over the past year, U.S. prosecutors have discussed several types of charges they could potentially bring against the WikiLeaks founder

The Justice Department is preparing to prosecute WikiLeaks founder Julian Assange and is increasingly optimistic it will be able to get him into a U.S. courtroom, according to people in Washington familiar with the matter.

Over the past year, U.S. prosecutors have discussed several types of charges they could potentially bring against Mr. Assange, the people said. Mr. Assange has lived in the Ecuadorean embassy in London since receiving political asylum from the South American country in 2012.

The people familiar with the case wouldn’t describe whether discussions were under way with the U.K. or Ecuador about Mr. Assange, but said they were encouraged by recent developments.

Ecuador’s relationship with Mr. Assange has deteriorated sharply since last year’s election of President Lenin Moreno, who has described him as a “stone in our shoe” and said his continued presence at the embassy is unsustainable.

An indictment from special counsel Robert Mueller that portrayed WikiLeaks as a tool of Russian intelligence for releasing thousands of hacked Democratic emails during the 2016 presidential campaign has made it more difficult for Mr. Assange to mount a defense as a journalist. Public opinion of Mr. Assange in the U.S. has dropped since the campaign.

Prosecutors have considered publicly indicting Mr. Assange to try to trigger his removal from the embassy, the people said, because a detailed explanation of the evidence against Mr. Assange could give Ecuadorean authorities a reason to turn him over.

The exact charges Justice Department might pursue remain unclear, but they may involve the Espionage Act, which criminalizes the disclosure of national defense-related information.

Mueller Probes Whether Roger Stone Contacted WikiLeaks