An uptick in monthly active users and increased advertising sales drove an improving revenue picture in Twitter's second quarter earnings Tuesday, although losses continued to mount.

The social media microblogging site has struggled since going public with flat user growth, and mounting losses. This quarter, however, Twitter appears to be turning things around thanks to events like the World Cup which drove user engagement. Whether that's enough to satisfy investors remains an open question. Twitter released its earnings after the close of U.S. markets on Tuesday.

"The World Cup drove increased engagment from existing users, but product changes drove new user growth," Chief Executive Dick Costolo said during an earnings call on Tuesday evening.

Twitter reported revenue of $312 million for the second quarter, ended June 30, an increase of 124 percent compared to the same quarter a year earlier. However, the company also reported a net loss of $145 million, nearly a quadrupling of the $42 million net loss it reported in the same quarter a year earlier.

Monthly active users increased 12 percent quarter over quarter to 271 million, compared to a 6 percent increase in the first quarter, and a four percent increase in the fourth quarter 2013.

In the second quarter, advertising sales, which makes up the majority of Twitter's revenues, increased 129 percent to $277 million year over year, with mobile ads comprising 81 percent of the total, Twitter reported. Meanwhile advertising per 1,000 timeline views, the company's metric for gauging ad sales, doubled to $1.60 compared to the second quarter in 2013.

Twitter's first quarter financials disappointed investors and analysts this spring due to the flatness of its new user growth. It posted a loss of $132 million in the first quarter, compared to a loss of $27 million in the same quarter a year earlier.

Twitter went public in November, with shares priced at $26. Its stock traded as high as $74 in subsequent months, only to be bid down by more than half after its first quarter earnings. Twitter's stock closed at $38.59 on Tuesday. Following the earnings call, the Wall Street Journal reported Twitter's stock had leapt to $50 a share in after hours trading.

"We are the world's real-time information network, and by giving everyone the best of Twitter, no matter how or when they consume our content, we will position ourselves to reach the largest audience in the world," Costolo said.