Instagram is taking a long-awaited step to launch itself into the advertising arena.

The three-year-old photo-­sharing site announced late Thursday that it will begin accepting photo and video advertisements, creating a potentially important source of revenue.

Wall Street immediately cheered the news. Shares of Facebook, which purchased Instagram in April, rose nearly 4 percent Friday to about $51 a share.

Generating advertising revenue has been one of Facebook’s greatest challenges. But after several missteps, the company has recently strengthened its advertising chops, especially for its mobile audience.

Arvind Bhatia, an analyst for the brokerage firm Sterne Agee, raised his price target for the company’s stock, citing the Instagram news. Facebook’s stock could reach $58 a share within the next year — if it can bolster its advertising products on the Web and mobile devices, Bhatia said.

Critical to that continuing effort is successfully integrating advertising onto Instagram, which has more than 150 million users, analysts said.

The photo service has a slightly different feel than Facebook — more immediate and less formal. Its broad, young audience could make it an attractive platform for advertisers, analysts say. The company recently added the ability to post 15-second videos to the site, which advertisers will soon be able to use.

Instagram has also been attempting to position itself as a source of news, similar to the
­ micro-blogging ­site Twitter. It has made a concerted effort to attract high-profile users, nabbing President Obama and first lady Michelle Obama.

Not all Instagram users are excited that they will soon have to sift through advertising to see a friend’s latest vacation shot or a celebrity selfie. “Great way to dilute your content,” wrote one user in response to the company’s blog post announcing the change.

In the blog post, Instagram said it will try to “make any advertisements [users] see feel as natural to Instagram” as the photos and videos that companies already share from their corporate accounts. Users will be able to “hide” ads they find inappropriate.

Instagram will begin introducing ads in the United States during the next few months.

“We have big ideas for the future, and part of making them happen is building Instagram into a sustainable business,” the firm said in the blog post.

Related stories:

Instagram updates to allow video imports

Follow The Post’s new tech blog, The Switch, where technology and policy connect.