MOSCOW — President Vladimir Putin said Thursday that National Security Agency surveillance is necessary to fight terrorism, but added that the government must “limit the appetite” of the agency with a clear set of ground rules.

Putin’s comment was surprising support for President Barack Obama’s administration, which has faced massive criticism over the sweeping US electronic espionage program.

He was speaking at his tightly choreographed annual press conference, a televised affair that goes on for many hours and attracts hundreds of journalists, some of whom were holding signs – or in one case an Olympic mascot teddy bear – in an effort to get called on for a question in front of a nationwide audience.

The Kremlin sees the event as key in burnishing Putin’s father-of-the nation image.

Putin, a 16-year KGB veteran and the former chief of Russia’s main espionage agency, said that while the NSA program “isn’t a cause for joy, it’s not a cause for repentance either” because it is needed to fight terrorism.

He argued that it’s necessary to monitor large numbers of people to expose terrorist contacts. But “on political level, it’s necessary to limit the appetite of special services with certain rules,” he said.

Putin added that the efficiency of the effort – and its damage to privacy – is limited by the sheer inability to process such a huge amount of data.

Asked about former NSA contractor Edward Snowden, whom Russia has granted asylum, Putin insisted that Moscow isn’t controlling him.

He argued that any revelations published by Snowden must have come from materials he provided before landing in Russia, and reaffirmed that Moscow made providing refuge to Snowden conditional on his halting what he called ant-American activities.

Putin said he hasn’t met with Snowden. He insisted that Russian security agencies haven’t worked with him and have not asked him any questions related to NSA activities against Russia.

Putin dismissed a report claiming that Moscow stationed its state-of-the art Iskander missiles in its Kaliningrad exclave region that borders NATO and EU members Poland and Lithuania, but added that he continues to consider such a move a possible way of countering the US-led missile defense system in Europe.

Both Poland and Lithuania have expressed concern about such a possibility, and Washington warned Moscow against making destabilizing moves. Putin said Russia has long considered it, but added that “we haven’t made the decision yet” on deploying them.

Turning to Ukraine, Putin insisted that Russia’s $15-billion bailout of the economically struggling country was driven by a desire to help a partner in dire straits and wasn’t linked to its talks with the European Union.

Ukraine has been an important customer for Russian gas and a key partner in industrial cooperation since Soviet times, he said.

The Kremlin’s move comes as Ukrainian President Viktor Yanukovych faces massive street protests over his decision to spike a pact with the EU in favor of closer ties with Russia.

Asked about the possibility of similar protests hitting Moscow one day, Putin said such demonstrations must be held in strict conformity with the law to prevent the nation from sliding into chaos.

Putin weathered months of massive protests against his rule in 2011-2012, when more than 100,000 gathered to oppose his return to the Russian presidency. A demonstration in May 2012 a day before his inauguration for a third term ended in scuffles with police.

An amnesty bill passed by the Kremlin-controlled parliament Wednesday included only 8 out of 26 people tried or awaiting trial in connection with that protest. Putin on Thursday defended the decision not to give amnesty others, saying that their release would give a bad example.

“No one should be allowed to violently trample on the law,” Putin said.

Putin confirmed that the amnesty will apply to the two members of the Pussy Riot punk band and the 30-people crew of a Greenpeace ship facing hooliganism charges for their protest at a Russian oil rig in the Arctic.

Asked whether he felt sorry for the two women, Putin stood by his strong criticism of their irreverent protest at Moscow’s main cathedral, describing it as a publicity stunt that “crossed all barriers”

He also questioned the Greenpeace protesters intentions to protect the Arctic and alleged that they were trying to hurt Russia’s economic interests. He added that he did not mind that charges against the Greenpeace team were dropped under Wednesday’s amnesty bill, but that he hoped that “this will not happen again.”

Journalists from across Russia waved handwritten posters with names of their cities to attract Putin’s eye, and one succeeded by holding up a Yeti doll in a T-shirt saying “I’m from Kuzbass,” referring to the Kuznetsk basin in Siberia, one of the largest coal mining areas in the world.