They had tried special diets, a mock wedding and even panda porn.
But after six years of increasingly elaborate rituals to entice male Chuang Chuang to mate with Lin Hui, staff at Chiang Ma Zoo, in Thailand, had given up hope.
They eventually resorted to the tried and tested method of artificial insemination and, earlier this week, their efforts paid off.
Doing well: Seven-year-old panda Lin Hu shortly after giving birth to her cub, which she is gently holding in her mouth
Staff were unaware that Lin Hui, a seven-year-old female, was even pregnant.
But on Wednesday she showed signs of stomach ache and shortly after gave birth to a tiny pink-coloured cub. The baby began screeching loudly immediately
It is too early to tell if it is male or female.
'She's been anxious. She did not want to get close to caretakers or any other people, but we didn't know what the problem was,' Chiang Mai Zoo's director Thananpat Pongamorn said.
'It is an ultimate happiness to see the baby panda.
The tiny cub can be held in one hand: It may be another week before keepers can determine if it's a boy or a girl
'We are so happy that we can breed a panda from artificial insemination. Every staff at the zoo is proud and I think every Thai will be proud too.'
Prasertsak Boontrakulpoonthawee, who heads the Chiang Mai Zoo's panda section, said the cub and mother were doing well.
'They are still healthy and strong, both mom and baby. There's nothing to worry about,' Prasertsak said.
'Whatever we can do to care for the pandas, we have already done.'
Welcome addition: Chiang Mai Zoo has been trying to breed a baby panda for six years
Lin Hui had been artificially inseminate on February 18 - but had showed no signs of pregnancy.
Zoo staff had been monitoring her hormone levels in recent weeks and noticed they were rising. But an ultra-sound scan as recently as May 11 did not show a foetus.
Enlarge Noisy: The panda cub began screeching loudly immediately after it was born
Panda births are difficult to predict and reports of false pregnancies are common.
Experts from China, which lent Thailand the pair of adult pandas in 2003, to examine the cub.
They will try to separate it from its mother, weigh the baby and determine its sex.
Pandas are threatened by loss of habitat, poaching and a low reproduction rate. Females in the wild normally have a cub once every two to three years.
Only about 1,600 pandas live in the wild, mostly in China's southwestern Sichuan province.
An additional 120 are in Chinese breeding facilities and zoos, and about 20 live in zoos outside China.
It is a rare occurrence to breed cubs outside China, with Thailand becoming only the third country after the United States and Japan to accomplish it.
The birth was featured on the front pages of many Thai newspapers, which carried photos of the pinkish cub so tiny that it could be held in the hands of a zoo staffer.
Others pictures showed the hulking mother Lin Hui gently holding her baby.
Panda cub born at Chiang Ma Zoo in Thailand | Mail Online