A court in Montenegro on Thursday found 14 people, including two Russians suspected of being spies, guilty of plotting a coup in 2016 to prevent the tiny Balkan country from joining NATO.

Prosecutors did not directly accuse the Russians of working for Moscow, but the case turned up possible evidence of an operation by the Russian military intelligence agency formerly known as the G.R.U. of using a nerve agent to poison a former Russian spy living in Britain last year and numerous other operations in the West. The agency has also been accused of interfering in the United States election in 2016.

The Russians, who were tried in absentia and are believed to be in Russia, “knowingly tried to terrorize Montenegrins, attack others, threaten and hurt basic constitutional and social structures,” the judge, Susana Mugosa, said on Thursday in court in Podgorica, the capital.

Judge Mugosa sentenced the two, who were referred to throughout the trial by the pseudonyms on their fake passports, Eduard V. Shirokov and Vladimir N. Popov, to 15 and 12 years in prison. It is unlikely they will serve the terms.