A novel proposal to tax targeted digital ads in Maryland could be extremely lucrative — provided it can survive an expected legal challenge from the world’s largest Internet and social media companies.

As Maryland lawmakers on Wednesday began debating whether to become the first state in the country to tax targeted online advertising, legislative analysts said such a tax could generate far more than originally estimated — as much as ­$250 million per year. That would cover roughly a quarter of the tab for Democrats’ prized plan to revamp public schools.

But analysts and opponents also cautioned that the online advertising proposal may run afoul of both the First Amendment and federal laws against taxing Internet companies in a discriminatory way. Opponents described the tax in catastrophic terms, and some suggested passage of the bill would lead to a lengthy court fight.

The digital ad tax is the first major policy pitched by Senate President Bill Ferguson (D-Baltimore City) since he took over the chamber in January and pledged to modernize the tax code. Though he acknowledged his first draft of the bill needs work, Ferguson, a lawyer, said the online companies that profit by collecting Maryland residents’ data should contribute to improving the state.

“This is the new economy in action,” he said. “Someone needs to lead, and Maryland should be that leader.”

The proposal would levy as much as a 10 percent excise tax on revenue companies receive from selling digital ads that target Maryland IP addresses.

Such ads typically tailor content based on users’ demographics and browsing history, among other data collected by Internet companies.

It would be up to social media companies to report how much they make off targeting Maryland’s consumers.

Firms with less than $100 million in annual global digital ad revenue would be exempt. The high threshold is designed to target the largest Internet companies, such as Google and Facebook, which research firm eMarketer said account for roughly ­59 percent of the country’s ­$130 billion digital ad revenue market.

Legislative analysts said the bill could apply to Amazon. (Amazon founder and chief executive Jeff Bezos owns The Washington Post.)

Economist and Nobel laureate Paul Romer kicked off a 90-minute hearing in Annapolis by telling lawmakers that Maryland could curtail runaway use of residents’ data by taxing the platforms that make money by tracking people online.

“It would be beneficial even if all you did was take the money and put it in the bank and didn’t spend it,” Romer told the state Senate Budget and Taxation Committee, adding that the tax creates an economic disincentive that would “undermine the monopolies that control all of the information about what we do.”

But Internet companies, business groups and advertising groups countered that the proposal was an unfair way to pay for the education overhaul and was tantamount to muzzling advertisers.

“It’s singling out protected speech,” said Vans Stevenson, a senior vice president with the Motion Picture Association.

Christopher Oswald of the Association of National Advertisers called the proposal “one of the most serious threats to advertising in the United States that we have encountered in decades.”

Digital advertising has grown by double digits into a more than $100 billion industry in the United States, according to several industry reports. Last year, according to eMarketer, digital ad revenue was expected to surpass spending on traditional ads for the first time.

“There’s a reason this industry is so successful and so large. It’s because it is the most cost-effective way to get a message out,” said Robert Callahan, a senior vice president for Internet Association, a trade group that represents major Internet firms.

Callahan and others told lawmakers the tax would make digital advertising more expensive for everyone, including Maryland’s small businesses.

Ferguson tapped Senate President Emeritus Thomas V. Mike Miller Jr. (D-Calvert) to help sell the legislation to lawmakers. The bill applies a graduated tax rate based on a company’s global advertising revenue.

The trade group representing Maryland’s news organizations warned that — despite the exemption for companies with less than $100 million in global ad revenue — the bill could potentially impact newspapers and other media companies that publish digital ads and rely on advertising to support newsgathering.

“Any diminishment of that revenue could be catastrophic for our members,” said Rebecca Snyder, executive director of the Maryland-Delaware-D.C. Press Association. The Washington Post is a member of the group.

Sen. Guy J. Guzzone (D-Howard), chairman of the committee that held the hearing, said a subset of the committee would form a work group to closely review the arguments for and against the tax before taking a vote on the proposal.

One Republican lawmaker flatly rejected it, saying it was antithetical to the state’s other efforts to attract and retain a technology sector.

“I don’t want to be the leader on this,” said Sen. Andrew A. Serafini (R-Washington). “We want tech companies to stay here. Image is my concern.”