Troubled Internet giant Yahoo's (NASDAQ:YHOO) sites have beaten those of prime rival Google's (NASDAQ:GOOG), to top comScores’ (NASDAQ: SCOR) monthly list of the top 50 U.S. websites by traffic, in July, for the first time in more than two years.

According to comScore's Media Metrix ranking released on Wednesday, Yahoo's sites had 196.6 million unique U.S. visitors while Google's sites -- which had held the top position for long -- received 192.3 million unique visits in July. The last time Sunnyvale, Calif.-based Yahoo surpassed Google’s traffic and topped the chart was in May 2011, and its web traffic increased 20 percent year-on-year in July, comScore data showed.

The development has surprised many but is regarded as a notable victory for Yahoo's CEO Marissa Mayer. Mayer, who came from Google to take control of Yahoo in July 2012, has made a number of acquisitions since then, including a $1.1 billion deal to purchase microblogging site Tumblr.

However, it remains to be seen whether Yahoo can keep its lead over Google for long. 

“Seems there are other factors at play, and given how close Yahoo Sites and Google have been in recent months, it can likely just be normal seasonal/month-to-month fluctuations,” a comScore representative told MarketWatch. He also added that traffic from Tumblr did not directly reflect in Yahoo’s traffic tally.  

Microsoft (NASDAQ:MSFT) sites came in third on the list of most visited U.S. websites, followed by Facebook (NASDAQ:FB) and AOL (NYSE:AOL) in fourth and fifth places, respectively.

Yahoo also topped the comScore Ad Focus rankings for July, reaching 87.2 percent of 225 million U.S. Internet users, while ShareThis came second in the list with a 87.1 percent reach, followed by Outbrain at third and Google at fourth place with 85.6 percent and 80.6 percent of reach respectively.

However, in search-engine traffic, Google remained the leader in July, topping the list with a 67 percent market share, while Microsoft’s Bing came in second capturing 17 percent of search-engine traffic and Yahoo was in third place with a 12 percent market share, according to comScore data.