As people lined up to legally buy the first marijuana retail products at two Massachusetts stores, Rep. Joe Kennedy III said he's changing his position on legalization.

"From health care to criminal justice, the failures of our nation's prohibition on marijuana can be seen in every corner of our society," he said in a Twitter post. "Status quo isn't working & states aren't turning back. It's time to legalize & regulate marijuana at the federal level."

Since his election in 2012, the former prosecutor had opposed legalization and other marijuana measures on Capitol Hill.

The Twitter post on his reversal included a link to an opinion piece he authored and had published on STAT, a news site focused on health and medicine. Marijuana legalization is "not a cure-all," he wrote.

"My concerns about the public health impact of marijuana remain," he continued. "But it has become clear that prohibition has wholly failed to address them. I believe legalization is our best chance to actually dedicate resources toward consumer safety, abuse prevention, and treatment for those who need it."

From health care to criminal justice, the failures of our nation's prohibition on marijuana can be seen in every corner of our society. Status quo isn’t working & states aren’t turning back. It’s time to legalize & regulate marijuana at the federal level. Read my @STATnews op/ed: https://t.co/q5ZHzYpRwz — Rep. Joe Kennedy III (@RepJoeKennedy) November 20, 2018

Kennedy, a Newton Democrat, is the grand-nephew of President John F. Kennedy. His district includes Brookline, Newton, Hopkinton, Foxborough, North Attleborough, Taunton, Somerset and Fall River.

Smart Approaches to Marijuana (SAM), which has railed against the new marijuana industry as "profit-hungry," said the group understands the "frustration" outlined in Kennedy's opinion piece. Patrick Kennedy, the former congressman from Rhode Island and a son of the late Sen. Edward Kennedy, is an adviser to the organization.

"Because the federal government - led by all political parties - has failed to adequately address state votes that are in clear violation of federal law, we are left in a limbo that allows pot companies to act just like their 20thcentury predecessors in Big Tobacco," the group said in its own statement posted to Twitter.