BOSTON — Attorney Shannon Liss-Riordan, a Democrat from Brookline who had been considering a primary challenge against U.S. Sen. Ed Markey in 2020, is now officially in the race.

"I have spent the last 20 years as a workers' rights attorney, fighting alongside those who have been taken advantage of by their employers," Liss-Riordan wrote in an email announcing her candidacy. "The cases I have fought — for tipped workers, employees misclassified as independent contractors, and low wage workers — have made me realize just how much the rich and powerful have reshaped our country to benefit them. They have been writing the rules for too long — we need to make a change."

Liss-Riordan first filed with the Federal Elections Commission to create a campaign committee on April 19 but had yet to formally launch a bid.

A labor attorney, she has represented drivers in a class action lawsuit against Uber and, according to her campaign website, brought cases that forced policy changes at Starbucks, FedEx, Harvard University and American Airlines.

A Malden Democrat who had served in Congress since 1976, Markey won his Senate seat in a 2013 special election that featured a primary battle against fellow U.S. Rep. Stephen Lynch, where Markey took in about 57 percent of the vote. Markey then beat Republican Gabriel Gomez 55-45.

Markey did not face a primary challenge in 2014, and defeated Republican Brian Herr with 62 percent of the vote in the general election. Markey had more than $3.5 million in his campaign account at the end of March.

Liss-Riordan is a graduate of Harvard Law School and Harvard College, and in 2009 co-founded the firm Lichten & Liss-Riordan. She lives with her husband and their three children.

"This country is stuck because of the cycle of Washington politics," Liss-Riordan said in a statement. "Washington needs a fresh voice willing to break that cycle. This election, the people of Massachusetts will have a choice. Maintain the status quo in Washington and stay in this endless cycle. Or vote for me and break it."