Russian president Vladimir Putin on Thursday dismissed allegations of collusion between Donald Trump’s campaign and the Kremlin during the 2016 U.S. presidential election and accused Washington of being obsessed with its own internal “spy-mania.”

Speaking at his annual end-of-the-year press conference in Moscow, Mr. Putin also praised President Trump and said there was nothing untoward about meetings Russians held year with Trump campaign officials and family members last year.

“What, we need to ban any and all contacts during any election in the world!?” Mr. Putin said in reference to such meetings, which have faced an unprecedented array of U.S. media attention, congressional and federal investigations during recent months.

“What here is out of bounds?” the Russian president asked. “Why should this all take on a character of spy-mania?”

The press conference lasted just under four hours, according to an accounting of Mr. Putin’s remarks from international news outlets and tweets from Russian reporters in attendance. Legendary for its length and heavily choreographed feel, the event was held before some 1,640 journalists, accredited to attend despite Russia’s reputation for severely restricting free press by Western standards.

In past years, Mr. Putin, who has ruled Russia since 1999, has fielded questions on a range of topics from his private life to the quality of country roads to serious foreign policy subjects, with some queries called in from across Russia’s 11 time zones. The vast majority — in addition to flamboyant signs journalists wave to catch Mr. Putin’s attention — are suspected of being planted by his handlers.

But Kremlinologists describe the occasion as a rich chance to witness flashes of Mr. Putin’s notoriously macho and sarcastic sense of humor, which often gets lost in translation. It was on full display Thursday, as the 65-year-old gestured to one colorful audience sign with an ambiguously subversive message. Roughly translated, the sign either said, “Putin bye-bye,” or “Putin Ba-Ba” — meaning “Grandpa Putin.”

Mr. Putin asked a female journalist near the sign if it said “bye bye.” She answered it was actually “Ba-Ba,” because children in the Russian region of Tatarstan call him grandfather. To the delight of the audience, Mr. Putin then quipped: “That basically sums up the vision.”

The Russian president has recently said he’ll stand for re-election in March and several questions on Thursday saw him mock his most visible opposition critic, Alexei Navalny, who’s been barred from running against Mr. Putin because of an embezzlement conviction. “It’s not my job to raise competitors,” he joked at one point, adding that the country has seen massive GDP and income growth during his 18 years in power.

Britain’s Telegraph newspaper noted that Mr. Navalny was live-tweeting during the event, making fun of the staged questions and Mr. Putin’s answers.

Mr. Putin spoke at length on accusations of state-supported doping that led to Russia being banned from the 2018 Winter Olympics in South Korea. An Associated Press report on the news conference said Mr. Putin suggested the FBI has manipulated evidence from the main whistleblower, Grigory Rodchenkov, who is under witness protection after fleeing to the United States last year.

U.S. agencies may be giving Mr. Rodchenkov unspecified “substances so that he says what’s required,” the president said.

On North Korea, Mr. Putin warned the United States not to use force, asserting that the consequences will be “catastrophic.” It’s been encouraging, he said, that U.S. Secretary of State Rex Tillerson has shown a readiness to talk with Pyongyang, but added it seemed “weird” that U.S. leaders expect Moscow to cooperate at a moment when Washington has sanctions against both Russia and North Korea.

But at another point, Mr. Putin suggested he’s eager to “normalize” relations with Washington. While he did not directly address American intelligence community allegations of Kremlin meddling in last year’s U.S. election, he echoed an argument the Trump administration itself has made during recent months — saying “all of it was invented by people who oppose President Trump, to undermine his legitimacy.”

About three hours into the press conference, Ksenia Sobchak, Mr. Putin’s presumed challenger in March’s election rose to ask a question. The 36-year-old Ms. Sobchak, who also works for an independent Russian TV channel, is the daughter of Anatoly Sobchak, a former St. Petersburg mayor and Putin political mentor.

Some analysts describe Ms. Sobchak as the Kremlim-approved opposition candidate. When Mr. Putin acknowledged her, he joked, “did you also deceive us and you’re here not as a journalist?” The previous questioner had reportedly caused a stir by engaging in a tirade about fish prices before admitting that he wasn’t actually a journalist but the chief of a fish processing plant.