In a historic first for Maryland, residents and fellow physicians at the University of Maryland Medical Center have voted to unionize, according to election results shared Thursday night by the Maryland chapter of the American Federation of Teachers.

Residents and fellows — doctors who have graduated from medical school and are receiving postgraduate training in their specialties — voted 628 to 19 to form a union in an election held by the National Labor Relations Board.

There are about 950 residents between the hospitals’ downtown and midtown medical campuses. For the doctors’ union drive to be successful, a majority of the 647 who turned out to vote had to be in favor of unionizing.

“This is an emotional day for all of us,” said Dr. Ari Goldstein, a third-year resident in the family medicine department, in an AFT news release. “We have spent countless hours over the last couple of years pouring our hearts into this effort on top of our already taxing duties as residents and fellows. To see this come to fruition is incredibly special because we know this will not only be a step forward for the current residents and fellows of the hospital but also for all those to come.”

The vote didn’t come as a surprise to the doctors involved in organizing efforts leading up to the election or to the AFT, the organization that now represents them.

More than 65% of the fellows and residents at the hospitals had signed union cards before the election, and nearly 500 signed a pledge signaling their plan to vote in favor of the effort.

In April, a group of residents and fellows approached the medical center’s leadership to ask them to voluntarily recognize their union. A few weeks later, Dr. Bert O’Malley — president and CEO of the Baltimore hospitals — instead requested that the NLRB hold an election to “ensure every single resident and fellow in the proposed bargaining unit will be able to have a voice in this important decision.”

In a statement Thursday night, O’Malley said the University of Maryland Medical Center respected the decision of the residents and fellows who voted in favor of unionizing and would bargain in good faith “with the goal of reaching an agreement that reinforces our commitment to extraordinary patient care and preparing the next generation of physicians for exemplary careers in medicine.”

“UMMC is proud of the Graduate Medical Education program we run across our two campuses and of the talented and compassionate individuals who make up our Resident and Fellow Physicians,” he said. “We will continue to make decisions that are in the best interest of their future success.”

Leading up to the election, the doctors now represented by AFT said they hoped unionizing would bring better pay and working conditions and a stronger voice to help them advocate for their patients.

Baltimore Mayor Brandon Scott, City Council President nominee Zeke Cohen and other local leaders voiced their support for the drive on social media and in letters to organizers.

Dr. George Sidrak, a second-year resident in the radiology department, cast his vote Wednesday in favor of a union. Residents work long days, he told The Baltimore Sun on Wednesday evening, as he headed home after a 12-hour shift. Unionizing won’t change that, but he hopes it will bring residents higher wages to better “balance out” the hours they work, he said.

Residents typically don’t have much of an opportunity to ask for higher pay or better benefits when placed at a hospital, said Dr. Liz Harlan, a second-year resident with the family medicine program. She’s hopeful a union will give her and her colleagues more power to negotiate with hospital leaders over issues like parking, meal stipends, maternity and family leave, and fertility benefits.

Harlan pointed to research that shows resident physicians are more likely to be in a car crash while driving home after working 24 hours or longer, compared with when they worked shorter shifts. Asking the medical center to provide reimbursement for the cost of a Lyft or Uber after residents finish a long shift is something the union might consider, Harlan said Wednesday.

With just one more year left in her program, Harlan isn’t sure whether she’ll still be a resident at the medical center by the time the union finishes negotiating a contract with hospital administrators. But having a union, she said, will benefit future residents at the hospitals.

The medical center’s residency program is joining other unionized residency programs across the country, including those at the UCLA Medical Center, University of Michigan Health System and Boston University Medical Center. In a statement, AFT Maryland President Kenya Campbell voiced her excitement for the doctors involved in the fight.

“The organizing committee has worked diligently over the past several years to organize their colleagues into a union that is best equipped to advocate for themselves and their patients,” she said. “Our state federation is excited to work with these brilliant medical minds to deliver great outcomes for workers that will only result in a better UMMC, and most importantly better quality of care for the surrounding community that relies on residents and fellows to keep us healthy and safe.”