Michael McFaul, the outgoing U.S. ambassador to Russia, speaks with a reporter in Sochi on Feb. 7. (David Goldman/Associated Press)

U.S. Ambassador ­Michael McFaul left Russia on Wednesday, a departure that attracted far more than the usual headlines for a change in diplomats and illuminated a tumultuous period in relations between the two countries.

The Russian news media covered him obsessively during his two years here. Liberal media found him accessible and quotable. Their government-oriented counterparts found him a convenient target for an official policy of anti-Americanism.

Not surprisingly, the coverage this week ranged from straightforward speculation on McFaul’s successor and the unlikelihood of a shift in U.S. policy to a televised interview with a rabidly nationalist member of parliament, Yevgeny Fyodorov, who expressed the extreme anti-American point of view.

“They sent him here to destroy Putin and to organize Orange Revolution here,” Fyodorov said, referring to President Vladi­mir Putin and Ukrainian uprisings, “and he failed.”

McFaul, 50, arrived in January 2012, just after the opposition had surprised Russian authorities the previous month with large-scale demonstrations against rigged elections and Putin’s announcement that he was going to run for the presidency in March that year, taking the office back from caretaker Dmitry Medvedev.

Putin, then the prime minister, was already ratcheting up the anti-­American rhetoric. He had accused Secretary of State Hillary Rodham Clinton of stirring up opposition against him.

On his second day of work (he met Russian officials the first day), McFaul accompanied visiting Deputy Secretary of State William J. Burns to meetings with opposition leaders. Soon, Kremlin-friendly newspapers and broadcasters were accusing McFaul of giving instructions to the opposition and trying to stir up a revolution.

From then on, McFaul frequently attracted hostile camera-toting followers who said they were journalists. (They never showed press credentials, he said.) He also was accused of directing the opposition to Putin. (McFaul said has never met anti-corruption blogger Alexei Navalny.) Trolls attacked him on social media. (He kept on blogging and tweeting, though.)

The public animosity was set off for domestic policy reasons and did not interfere with his official dealings, McFaul said.

Still, the episode hovered over him until his last days here, with Russian journalists bringing it up in their final interviews. Suggestions in some of the coverage that his inexperience as a diplomat led to the meetings with the opposition leaders — he was an academic who served three years as President Obama’s chief adviser on Russia — clearly exasperated him.

“I didn’t want to do that meeting,” he said. “It was organized for Deputy Secretary Burns, one of the most experienced diplomats in our government. It was organized by experienced diplomats at our embassy. ‘Can I not go?’ I said. ‘No, your job is to accompany all senior diplomats.’ That was a mistake. I should have put my foot down.”

McFaul encountered serious diplomatic challenges. In September 2012, Russia expelled the U.S. Agency for International Development, an escalation of Putin’s effort to prevent what he saw as U.S. financing of Russian organizations that opposed him.

After the U.S. Congress enacted the Magnitsky law in December 2012, imposing sanctions on Russians implicated in human rights abuses, Moscow retaliated by banning U.S. adoptions of Russian orphans.

“I expected a reaction,” McFaul said. “We expected a similar law. Not in a million years would I have thought there would be a ban on adoption. For me personally, it had a major and negative effect on our relations.”

As Obama’s Russia adviser before becoming ambassador, McFaul was the author of the administration’s “reset” policy, an effort to find agreement with Moscow in areas in which interests overlapped.

“We’ve had a pretty solid level of achievement,” he said, “not as ambitious as we hoped, but when I look at what we got done compared to other administrations, it’s a pretty good record of achievement.”

Among the achievements, he lists Russian cooperation on supply routes to Afghanistan, joint efforts on Iran and North Korea, and resolution of trade issues.

McFaul said he decided to leave the job because his family had returned to California for school reasons last fall and he had been apart from them too long.

Even as he left, he was talking about human rights, criticizing the sentencing Monday of seven anti-Putin protesters to up to four years in prison. The State Department called the trial politically motivated and said it lacked due process.

McFaul was given a fond farewell in the world of Twitter, where he had engaged individual Russians by sending out 10,300 tweets in his two years here.

“How sad there are so few open and soulful people in Russian political life,” one tweeter wrote to McFaul. “Thanks for strengthening U.S.-Russian ties,” another wrote. “Don’t pay attention to all the disinformation,” a third advised.

And then McFaul flew off, leaving behind 61,200 followers.