The court also found that secret spying on a female editor of the BNS Vilnius news desk was against the law.
The BNS news agency described the ruling as an important precedent, which will help to ensure protection of media sources, one of the key conditions for media freedom.
"The BNS news agency hopes that the court ruling will encourage law-enforcement institutions to take a more cautious stance on the validity of application of procedural coercive measures that may violate the privacy of individuals and media freedom," BNS said in a press release.
Under the ruling, secret surveillance upon journalists and wiretapping of their conversations are extreme and exceptional measures that can be applied after exploiting all other possibilities of revealing sources.
Upon request from the Special Investigation Service and the Prosecutor General's Office, wiretapping and spying of BNS journalists was sanctioned by the Vilnius City District Court. Three BNS editors had filed a suit against the rulings.
In June, BNS was informed by the Prosecutor General's Office that a recent pre-trial investigation into the leak of a state secret and abuse of office involved wiretapping and recording of telephone conversations of 17 former and current BNS employees. According to the information, it was also allowed to carry out searches at the home of a BNS editor, put her under secret surveillance, make audio and video recordings and photos, use all types of equipment for audio and video recordings as well as surveillance.
Some of the remaining current and former BNS journalists who were subjected to the wiretapping intend to file their suits next week, as they have just received responses from the court to their requests to study the ruling.
This is not the first court ruling to dismiss the measures as ungrounded. Last December, the Vilnius court ruled that the sanction of the search of a BNS editor's home and the instructions to disclose her source of information was unlawful.
The probe was launched last year after BNS reported that Lithuania's State Security Department had warned state leaders and two parliamentary committees about possible informational provocations by Russia. The case has been handed over to court, with presidential spokeswoman Daiva Ulbinaitė named as the prime suspect.