J.P. Morgan upgraded Twitter to overweight from hold on Monday, boosting shares of the social media stock, which have been staging a comeback this fall.

"We are upgrading TWTR shares to overweight with a $27 price target," analyst Doug Anmuth wrote in a note. He called it "one of our top" small- to mid-cap picks for 2018.

"We believe both the TWTR story and financial results will strengthen over the next year as the company continues to build on its differentiated value proposition for users & returns to revenue growth," he wrote.

The new $27 target (up from a previous target of $20) represents 22 percent upside over the next 12 months from Friday's close. Twitter jumped 6 percent in early trading Monday.

After struggling the previous three years as bigger rival Facebook reached higher and higher heights in terms of user numbers and stock price, Twitter rebounded in the second half of 2017 as investors bet the stock had reached a point that made it a value given its core user base that it had yet to truly effectively monetize.

"We recognize that TWTR shares are up 30 percent since 3Q earnings in late October and are not cheap at 11.8x 2019E EBITDA on our revised numbers," wrote Anmuth. "But we believe increasing traction with both users and advertisers will drive upside to 2018 consensus (we are 4 percent above on revenue & 15 percent on EBITDA) and investor sentiment around TWTR remains mixed."