BOSTON - A federal appeals court has ruled that the MBTA violated free speech rights by refusing to display ads from a group that wants to legalize marijuana.

The 1st U.S. Circuit Court of Appeals found the MBTA's refusal to display three ads submitted by the nonprofit group Change the Climate violated the U.S. Constitution because it was based on subway officials' disapproval of the views expressed in the ads.

The MBTA rejected the ads four years ago, claiming they encouraged children to smoke marijuana. The transit authority argued that is has the right to protect riders from offensive or illegal messages.

In a ruling issued Monday, the 1st Circuit found that the MBTA regularly displays liquor ads that are more appealing to juveniles than the ads on marijuana laws.

"MBTA advertising space is literally a billboard for the expression of opinions to citizens at large. As a government agency, they shouldn't have the right to pick and choose what opinions they allow to be advertised," said Harvey Schwartz, an attorney for Change the Climate, which is based in Greenfield, Mass.

The ruling orders the MBTA to display the three ads submitted by the group.