This is the last holiday season that online shoppers in Massachusetts will be able to avoid paying sales tax when buying gifts through Amazon.com.

After a long back-and-forth between brick and mortar business advocates and the online retail giant, Governor Deval Patrick announced Tuesday that starting next fall, Amazon.com will begin collecting the 6.25% Massachusetts sales tax on purchases made by Bay State residents from the site.

“We are thankful Amazon was willing to come to the table and we will continue our conversations with them about creating jobs here. This agreement is a win for all sides, and I am pleased it promises to generate millions in long-term revenue for the Commonwealth,” said Governor Patrick in a statement on Tuesday.

Besides bringing millions of dollars to Massachusetts through the collection of sales tax, the move will also create hundreds of jobs in the technology industry, Patrick said.

The battle to get Amazon to collect taxes has been an arduous one for local businesses and retail associations, but advocacy groups that fought for “fairness” are pleased with the latest news.

“Our members are grateful and relieved to know that they will not have to face another holiday sales season with a 6.25% tax disparity with the world’s largest online seller,” said Jon B. Hurst, President of the Retailers Association of Massachusetts. “Although we would have preferred a level playing field this holiday season, we are grateful to Governor Patrick for his tireless work on this issue. Unfair sales tax application is an antiquated policy that favors out of state businesses over local employers and it has to end. The announcement today is an important and significant step toward realizing that ultimate goal.”

Prior to Patrick’s announcement Tuesday, Amazon.com was able to avoid collecting from Massachusetts consumers based on a “loophole” stemming from a US Federal Court decision handed down twenty years ago.

According to that decision, online retailers were exempt from collecting sales tax on most online purchases unless they had a physical presence in a state.

However, since Amazon.com recently rooted itself in Cambridge and North Reading, brick and mortar store owners didn’t think they should be exempt from the state sales tax any longer.

In September, Salem Mayor Kim Driscoll and members of the Main Streets Fairness Coalition made a new push to get legislation passed so that online retailers would be forced to charge the tax on purchases in Massachusetts, claiming their exemption hurt small businesses and store owners.

A nearly two-page letter was then sent to Governor Patrick after being signed by several Bay State mayors, including the Hub’s own Mayor Thomas Menino. The letter urged Patrick to take immediate action and “aggressively” move to make sure places like Amazon.com were in full compliance with Massachusetts tax laws.

Then, in November, the group released an economic report, detailing findings from 2011, which showed that Massachusetts lost 1,970 new jobs, $280 million in sales to local businesses, as well as $387 million in state tax revenue due to the “loophole.”

Driscoll said on Tuesday that the latest push is a step in the right direction, but more still needs to be done on a federal level.

“Once again, Massachusetts is taking action on an important issue ahead of our leaders in Washington,” said Driscoll, Co-Chair of the MMSFC. “In the age of the smart phone, sales taxes should be applied the same for purchases whether made on Main Street or online. We are grateful to Governor Patrick for his leadership in leveling the playing field between our Main Street businesses and Amazon.”