Updated Dec. 12, 2:20 p.m.

Dozens of people crowded outside the brand new Medford/Tufts Green Line station before sunrise on its opening day today, hoping to board the first train on a transit expansion decades in the making.

The celebration was lively: A live brass band played, and Somerville’s mayor, Katjana Ballantyne, danced with the city’s former mayor, Joe Curtatone to the notes of "When the Green Line Comes Marching In.”

Passengers can now board the train at East Somerville, Gilman Square, Magoun Square, Ball Square and Medford/Tufts University. Most Somerville residents live within a 12-minute walk of a T stop, Ballantyne said.

The Green Line extension, an idea first conceived 100 years ago, gained steam during the construction of the Big Dig. With highways expanding and little being done to curb pollution coming from cars cruising down them, the Conservation Law Foundation filed a lawsuit in 1991 to make Massachusetts address emissions and provide transit alternatives.

One of the proposed solutions was expanding the Green Line into Medford and Somerville. But the project was slow to come to fruition, repeatedly delayed as costs rose and the project fell down the state’s list of priorities. The extension also included a branch to Somerville’s Union Square, which opened in March.

“I’m just totally thrilled,” Ballantyne said. “Thrilled for the 30 years of advocacy that’s been going on. It’s just a huge accomplishment. Let’s hope the next infrastructure project doesn’t take as long.”

In a gathering at the Joyce Cummings Center later in the morning, MBTA General Manager Steve Poftak hosted an event celebrating the opening and thanked the people who made it possible, including Governor Charlie Baker, who praised the work of former Congressman Mike Capuano.

“You can't build a project like this on good intentions and words. You need dollars,” Baker said. “The main reason we were able to pay for this project was because then-Congressman Capuano got $1,000,000,000 from the federal government to pay for half of the price of this project.” Baker dedicated the new $250 million vehicle maintenance facility on the Green Line extension to Capuano.

Senator Elizabeth Warren used the occasion to challenge the crowd. “We need to do better. We need a transportation system that works. ... We need a T that is cleaned up and runs on time. And yes, Orange Line. I'm looking at you," said Warren, referring to persistent slow zones on the refurbished subway line and problems with power failures over the weekend. Warren touted the Bipartisan Infrastructure Act as an opportunity to expand public transportation even further.

The first train rolled into the station around 5 a.m. Monday morning, and people piled onto it. Among them were long-time activists, local residents and a group of Tufts students who cheered for its arrival.

“Since I live in Boston, usually it would be easy to get home. But for some reason this campus makes it extra hard,” Tufts student Bendu Sesay said. “Now with the Green Line, I can just hop on, hop off, and boom, I’m home.”

Meredith Porter was excited to be on the first train, but then turned attention to another issue: Gentrification. Some landlords are using the new Green Line stops as an excuse to raise rents, pushing out long-time residents and vulnerable communities the mass transit line was originally intended to serve.

“It’s perverse, what’s happened. We now have better transit to underserved communities, but people are being pushed out of those communities, the very people transit was brought here to serve,” said Porter, demonstrating with the Community Action Agency of Somerville.

“We're really fighting to lift that ban on rent control that was passed in 1994 so cities and towns can have their own options for rent stabilization," said Nicole Eigbrett, also of the Community Action Agency of Somerville. She added that Mayor Ballentyne has been a strong ally of fair housing advocates by investing in rental assistance, legal aid and municipal housing vouchers.

A family affair

For the O’Neill family, the extension’s opening is an opportunity to connect generations. Lily O’Neill came with her mother, Mary O'Neill Kinler, and her grandmother, Eileen O’Neill. They lined up on the platform before 5 a.m., to honor Eileen O’Neill’s late husband Dan O’Neill, an MBTA bus driver.

“It’s great to be on the train,” Eileen O’Neill said. She lives across the street from the railroad tracks, her daughter Mary O'Neill Kinler said, and has been watching workers build the extension for years. The new station is a link to another one of her granddaughters, who goes to Northeastern University on the Green Line’s E branch.

“She relies on the T quite a bit, and this is going to be fantastic for her,” O'Neill Kinler said of her mother.

Evan Bouwens woke up early on his 18th birthday Monday to ride the inaugural train. Passengers fond out and joined in to sing happy birthday to him.

“This is the earliest I’ve woken up in my life,” he said.

Why wake up for this?

“Because it’s a train,” he said. “Trains are the best mode of transport.”

The opening marks the conclusion of a $2.3 billion project that's been under construction for four years. Officials say planning is underway to extend the Green Line another mile to the Mystic Valley Parkway, which was part of the original plan that had to be downsized due to cost.

GBH News' Mark Herz contributed to this report.