A police source said the woman was shot in the face.
The child was grazed, the source said.
The gunfire apparently came from someone on the sidewalk, Metro spokeswoman Caroline Lukas said.
The shooting apparently occurred at 18th Street and Minnesota Avenue, said Jackie L. Jeter, the president of the labor union that represents Metro employees in the District. The woman may have been shot in the doorway of the bus, she said.
The driver “pulled the bus away to get out of danger” before stopping at 19th and Minnesota, she said. Maps show bus stops at both intersections.
No motive could be learned immediately, but authorities said it appeared that the woman was targeted. She was hit by bullets more than once, police said.
A woman who lives near the scene said a man had been arguing with the woman before the gunfire.
“He didn’t want her to get on the bus,” she said.
Police searched the area for the attacker, but as of late Sunday, no arrest had been reported.
After the bus halted at 19th and Minnesota, police cordoned off an area around it, inside a neighborhood of modest single-family houses and small apartment houses on tree-lined streets.
“We need you to get inside,” an officer told a woman near the crime scene. “We need you to get inside.”
Residents who approached the scene said it appeared that the woman’s body lay inside the bus for some time.
It was not immediately clear how many people had been on the bus on the B2 route, from the Anacostia Metro station to Mount Rainier. In addition to running along Minnesota Avenue in Southeast, the route goes through neighborhoods on both sides of the Anacostia River.
The shooting appeared to be the 80th homicide this year in the District. The number of killings is substantially below last year’s toll.
The victim was not identified immediately. Lanier said the woman’s relatives had not formally identified her.
Jeter, president of Amalgamated Transit Union Local 689, who went to the scene, said the bus driver was uninjured but was taken to a hospital for evaluation.
“He was extremely upset, as anyone would be,” Jeter said.
Residents of the Fairlawn neighborhood, where the attack occurred, were also struck by the tragic nature of the episode.
Barbara Clark, an advisory neighborhood commissioner in the area, was among those who went to the scene and stood outside the police tape in the dampness and drizzle.
“I’m just concerned,” she said. “That baby is without a mother.”