MOSCOW — Russia's highest court has upheld a land swap deal in the North Caucasus which caused large-scale protests.

Thousands of people rallied for days earlier this year after the leaders of the provinces of Ingushetia and Chechnya signed the agreement to exchange unpopulated plots of agricultural land. The deal and the secretive manner in which it was adopted fueled a popular view that authorities had betrayed their interests.

The Russian Constitutional Court on Thursday overruled a decision by Ingushetia's high court which ruled in October to invalidate the deal. The Constitutional Court said that the leaders of the two provinces had the right to sign the deal without putting it up for a referendum vote, contrary to what the Ingush court had argued.