Mei Xiang, the National Zoo’s female giant panda, delivered a “miracle” cub Friday — becoming at 22 the oldest giant panda to give birth in the United States and giving Washington its first giant panda cub in five years, the zoo said.

The cub was born about 6:30 p.m., after Mei Xiang had been in labor for about 3½ hours. It could be heard squawking on the zoo’s panda cam, as its mother licked and cradled it.

The pregnancy had been “a miracle” because at her age Mei Xiang had a less than 1 percent chance of having another cub, the zoo said.

“This is like that Hail Mary football pass,” chief veterinarian Don Neiffer said last week.

Zoo director Steven Monfort rejoiced Friday night: “We have a panda cub!”

The happy event comes as Washington and the nation are in the midst of a deadly pandemic, waves of social upheaval and a bitter presidential campaign season.

“If there was ever a time that Mei Xiang needed to do us a [favor] and have a baby, it’s right now,” Neiffer said last week. “In the middle of a pandemic, this is a joyful moment.”

Giant pandas are enormously popular at the zoo and have a band of devoted followers.

Mei Xiang went into labor, huffing and appearing restless, about 3 p.m. Friday, as viewers looked on via the zoo’s black and white panda cam.

So many were watching that the feed kept breaking down, the zoo said.

“We only have so much bandwidth,” Monfort said. “We’re afraid we’re going to break the Internet.”

The panda’s pregnancy came about despite Mei Xiang’s age, and her insemination with 5-year-old frozen semen from her mate, Tian Tian, said zoo research biologist Pierre Comizzoli.

Mei Xiang is the first giant panda in the United States to give birth after the use of frozen semen, he said. Scientifically, “that’s a huge accomplishment,” he said.

In addition, “we know that in terms of reproductive age, this is pretty advanced for a giant panda female,” he said Monday.

In November, as the zoo sent its cub, Bei Bei, off to China, as required by agreement, zoo officials said they did not expect another cub for a while.

“He is probably the last cub we’ll have here in a long time,” Brandie Smith, the zoo’s deputy director, said. “It’s sad because it’s . . . the end of an era for the panda program at the National Zoo.”

Mei Xiang had, by then, had at least nine “false pregnancies,” which are common in giant pandas and happen when the animal exhibits early signs of being pregnant but no cub appears.

She turned 22 in July and her days of motherhood seemed to be over.

“She’s aged,” Neiffer said.

But in March, she began her reproductive cycle normally and she was artificially inseminated on March 22. Zoo scientists monitored her as usual during her five-month gestation period.

Neiffer said some clues started emerging two weeks ago on ultrasounds, which provide images of the uterus. They showed “tissue growing that was not the uterus,” he said.

Then, on Aug. 14, he was able to conduct an ultrasound and spotted the fetus.

He was able to get “10- to 20-second video clips of [the panda’s] abdomen,” he said. “Immediately, the structures that we saw [earlier] were much bigger, and I was convinced.”

He predicted a birth could come within days.

Zoo officials were exultant. Volunteers went on 24-hour-a-day watch via panda cam. The public watched, too. Panda-cam views had soared 1,000 percent since Friday, the zoo said.

Another ultrasound Monday again showed the fetus.

Sometimes giant pandas bear twins. In 2015, when Bei Bei was born, he had a male twin. But the twin inhaled some kind of food product, contracted pneumonia and died four days later.

In 2013, when the female cub named Bao Bao was born, a twin was delivered deceased the next day.

Neiffer said he did not think the quiet during the zoo’s shutdown had anything to do with the pregnancy. He noted that Mei Xiang has gotten pregnant in the past when the zoo was open and going “full tilt.”

Mei Xiang has given birth to three surviving cubs: Bao Bao, Bei Bei and Tai Shan.

Tai Shan was born in July 2005 and now lives in China. Bao Bao was moved to China in February 2017. Bei Bei was born on Aug. 22, 2015 and moved to China in November 2019.

By agreement, all cubs born at the zoo are sent to China when they are 4 years old. China owns and leases all giant pandas in U.S. zoos.