SEOUL, South Korea — Nine agents from South Korea’s National Intelligence Service wrote more than 5,000 posts on the Internet in a psychological warfare campaign against North Korea since 2009, using some of them to attack domestic opposition parties and their candidates ahead of South Korea’s presidential election last December, state prosecutors said on Friday.

The agents’ top supervisor, Won Sei-hoon, the former director of the intelligence agency, was accused of overseeing the online operation and was indicted on Friday. Prosecutors said they did not indict the nine agents because they were simply obeying Mr. Won’s instructions — a decision that the political opposition called a whitewash on Friday.

Mr. Won, who was not arrested, faces trial on charges of breaking the national election law, which bars government officials from using their influence to affect a vote, and of violating a separate law that prohibits government intelligence officials from meddling in domestic politics.

While announcing the results of their two-month investigation, prosecutors did not comment on whether or how the operation affected the Dec. 19 election. President Park Geun-hye, the governing party’s candidate, won one million more votes than her chief rival, Moon Jae-in, the candidate of the main opposition Democratic Party and a major target of the online criticism.