Elon Musk's The Boring Company has axed its plans to build an approximately 2-mile-long tunnel under western Los Angeles.

The decision came after several local groups sued the city over its plan to exempt the project from environmental regulations and The Boring Company settled with them.

The Sepulveda test tunnel would have run in Los Angeles Culver City. The company came up with the idea for the project in 2017. It is continuing to pursue other tunnel projects.

Elon Musk's The Boring Company has abandoned its plans to build a massive subterranean tunnel under western Los Angeles.

The company withdrew plans for the Sepulveda test tunnel on Tuesday, which came after several local groups sued the city of Los Angeles over its plan to exempt the project from environmental reviews.

The tunnel would have run from a Boring Company property on Sepulveda Boulevard to Washington Boulevard in Culver City, ABC reported. The company came up with the idea for the project in 2017.

Read more: This picture of hellish Los Angeles traffic shows why we need a transportation revolution

How The Boring Company envisioned its subterranean tunnels in an April 2017 video. The Boring Company/YouTube

A Boring Company spokesman said in a statement, cited by NBC News and The Daily Beast:

"The parties (The Boring Company, Brentwood Residents Coalition, Sunset Coalition, and Wendy-Sue Rosen) have amicably settled the matter of Brentwood Residents Coalition et al. v. City of Los Angeles (TBC -- The Boring Company).

"The Boring Company is no longer seeking the development of the Sepulveda test tunnel and instead seeks to construct an operational tunnel at Dodger Stadium."

The Dodger Stadium tunnel — named the Dugout Loop — would ferry fans from subway lines to the ballpark where the Los Angeles Dodgers play.

The approximately 3-mile trip would take four minutes and cost $1, the company said.

What The Boring Company imagined its tunnel looking like. The Boring Company

The Boring Company is also continuing work on its Test Tunnel, expected to run for about 2 miles from a parking lot at the SpaceX headquarters in Hawthorne, the company's website said.

Musk said in October that the tunnel would open on December 10. He also tweeted footage of the company's drill completing its first tunnel earlier this month.

Musk told the "Joe Rogan Experience" podcast in September that The Boring Company "started out as a joke" and that the idea to tunnel under Los Angeles was born out of "desperation."

Read more: Elon Musk shared 2 videos of the Boring Company's giant drill completing its first tunnel at the bottom of a huge pit