MOSCOW — The United States ambassador to Russia announced Tuesday that he would resign after the Winter Olympics, set to begin in Sochi this week, ending a stormy two-year tenure during which relations between the two countries were at their lowest ebb since the end of the Cold War.

Ambassador Michael A. McFaul, who spearheaded a “reset” in relations between Russia and the United States as a senior adviser to President Obama during the president’s first term, often served as a lightning rod for criticism from Russian officials who accused the State Department of funding opposition politicians and interfering in the country’s internal affairs.

“After more than five years working in the Obama administration, it is time to go home,” Mr. McFaul wrote in a blog that he updated regularly. He added that he wished to spend more time with his family.

Mr. McFaul pointed to successes in promoting cooperation on issues including counterterrorism and cybersecurity.