Metro will stay open at least one hour past its regular 11:30 p.m. weeknight closing time for the Major League Baseball All-Star Game on July 17, as well as the Home Run Derby on July 16, the agency said Thursday.

Mastercard will sponsor the service, Metro said. Metro also will run additional trains on the Green Line to provide extra capacity for both events.

“We are excited to welcome the All-Star Game to Washington and to support all of the events with good transit service from start to finish,” Metro General Manager Paul J. Wiedefeld said in a statement. “Whether you’re going to FanFest at the Convention Center, PLAY BALL Park in The Yards or the Home Run Derby or All-Star Game at Nationals Park, Metro will be the way to go.”

Metro has closed at 11:30 p.m. on weeknights since summer 2017, when Wiedefeld implemented new operating hours aimed at extending the overnight maintenance windows for the system. Metro requires outside sponsors to pay for late-night and special event service at a cost of $100,000 per hour. The deposit can be fully refunded if Metro turns a profit during the extended service window.

The Nationals have in the past refused to pay for the service, meaning sponsors have needed to come forward to cover the cost.

“We’re planning for large crowds throughout MLB All-Star week, and the more transportation options our residents and visitors have access to, the better,” D.C. Mayor Muriel E. Bowser said in a statement. “Being able to get home safely after having a great day at MLB All-Star activities is priceless, and we want to thank the team at MasterCard for ensuring that our fans can have fun and travel safely during this exciting week of events.”