In 2006, in a yard at the Bronx Zoo, Happy the elephant took a few steps toward an eight-foot mirror — and lumbered into history.

A researcher had painted a white X on her head, just above the right eye. She couldn’t see it or feel it. What would happen if Happy noticed the mark in the mirror?

It was an experiment to determine if elephants, long known for their intelligence and strong family bonds, were also self-aware. If so, they would join a select group of animals — humans, apes and dolphins — with the ability to see themselves as others might.

Happy was the final hope. Two of her fellow residents of the Bronx Zoo had failed the test.

After being released into the enclosure, Happy walked straight to the mirror, then backed away. She moved in and out of view of her reflection. Soon, Happy’s trunk inched up to the mark, touching the X tentatively as if inspecting a new hairdo. She eventually would touch her head 47 times.

The researchers were thrilled. The team, headed by an Emory University graduate student, Josh Plotnik, published the results in a journal of the National Academy of Sciences.

Video of Happy gazing at herself in the mirror went viral. A book on elephant behavior devoted a chapter to her as the study proved the earth’s largest land animals have a depth previously unknown. Happy was a star.

Six years later, a reporter took a ride into the elephant area of the Bronx Zoo called Wild Asia, which is accessible only by monorail. It’s a rambling, leafy section of terrain where the zoo’s biggest attractions reside: tigers, rhinos and elephants.

It’s the same area where a man was mauled two weeks ago after leaping into a tiger den.

Not far away is the elephant exhibit, where on this day two of them plodded about near a small pond.

“There’s two of our beautiful friends, Patty and Maxine!” chirped a tour guide.

Afterward, he was asked if they were the only elephants at the zoo.

“Yeah,” he said. “Just those two.”

An informal survey of other zoo workers revealed an astonishing fact: Most thought that Patty and Maxine — 40-year-old Asian females and the two other research subjects that failed Plotnik’s self-awareness test in 2006 — comprised the zoo’s full complement of pachyderms.

Happy, one of the most famous elephant in the zoo, if not the nation, had vanished.

‘She should be there; that’s what our records indicate,” said Ashley Byrne, a spokesperson for the animal-rights group PETA, which closely monitors elephants in captivity, including those in The Bronx.

“We do keep track because when a zoo has decided an animal is no longer useful to them, we sometimes see them being sold off to roadside zoos or even canned-hunting facilities.”

A clue was provided by a YouTube video posted on June 8, 2010. It showed Patty and Maxine near their pond. A caption read: “Happy is not here, as she does not ‘get along with’ one of these two.”

Wildlife conservationist and author G.A. Bradshaw noted something similar in her book, “Elephants on the Edge — What Animals Teach Us About Humanity.”

“She has two neighbors who are contemporaries, Patty and Maxine, but the two have formed a fast friendship, leaving Happy something of a third wheel.”

The question of Happy’s circumstances was put to the zoo’s spokesperson, Mary Dixon, who didn’t immediately respond. A closer look at Happy’s life revealed a disturbing secret.

She was born in 1971 in Thailand and captured as an infant. She landed at a zoo in Hawaii for a few months. In 1973, she was shipped off to West Palm Beach, Fla. Four years later, she arrived in The Bronx.

During all that time, she had a constant companion, a male named Grumpy. He was the same age, also from Thailand, and was captured in the same year as Happy — meaning he was probably her brother, cousin or other close relative. He traveled with her to Hawaii and Florida and came to The Bronx with her in 1977.

But in 2002, Grumpy died, the cause of death listed initially as “unknown.”

A follow-up record uncovered by a Swedish elephant authority, Dan Koehl, showed that Grumpy was attacked by Patty and Maxine and “killed after sustaining injuries from being beaten up by [them].”

“It had to be a pretty violent situation,” said Ed Stewart, co-founder of the animal-advocacy group PAWS, which runs an elephant sanctuary in Northern California. “It’s a tragedy, but things like that just don’t happen in the wild.”

Deaths in captivity are not uncommon.

Another elephant, Tus, died at the Bronx Zoo in 2002 from an unknown cause. The passing of Grumpy and Tus went unreported in the press.

Happy — approaching middle age at 31 in 2002 — was left to herself.

The zoo found Happy a new companion. Sammy, a male young enough to be her son, was introduced and the two hit it off. The handlers were encouraged.

Four years later, when Plotnik launched his study, he took note of how well Happy and Sammy got along.

“They had a very good relationship,” he told The Post. “Just as Patty and Maxine had a very good relationship.

“But the two groups stayed away from each other. I never saw them mixing — and I was there for months.”

Happy’s luck didn’t last. Shortly after Plotnik’s research concluded, Sammy passed away from liver disease. Happy was alone again.

Plotnik’s study of elephants shamed many zoos. After its publication, the Bronx Zoo announced it would close its elephant exhibit after any of its three remaining elephants died.

And it would take on no new animals until that time.

The announcement was considered a bold move — elephants have long been among the most popular among visitors, and their loss could hurt revenue.

But it was applauded by conservationists and behavioral scientists, who believe elephants should be left in the wild or kept in sanctuaries, where they have significantly more room than zoos can provide.

It also intensified the scrutiny of the conditions of elephants at zoos.

In The Bronx, a team of caretakers must constantly work on the feet of Happy, Maxine and Patty, scrubbing the pads and filing down their nails — something not necessary in the wild, where elephants walk as much as 30 miles per day.

Without that care, they likely would develop foot or joint problems, a common cause of death for zoo and circus elephants.

Happy’s mental state was another matter.

“If that animal is all alone, that would be extremely stressful,” said Byrne. “Elephants have close family dynamics, and interaction is essential to their well-being.”

Observers worry that Happy, forced to live in proximity to two alpha females who killed her lifelong companion, could slide into despair, something that has occurred at other facilities.

So the zoo went against its vow — and brought in another elephant to keep her company, according to a zoo handler.

But the new arrival, a young male named Jumbo whose mother passed away at another location, was adopted by Patty and Maxine. The gamble backfired.

Happy spends most of her time indoors in a large holding facility lined with elephant cages, which are about twice the length of the animals’ bodies. The public never sees this.

On Sept. 22, after Post inquiries, Happy was finally spotted. She’d been put in the elephant exhibit — alone — while Patty and Maxine appeared mostly out of view in a separate enclosure on the opposite side of the monorail.

In a written statement, Dixon claimed Happy was out in public “regularly.”

“Rotating animals through exhibits is part of our behavioral-enrichment efforts,” she wrote. “I am not sure, but she may even be out tomorrow. When not on exhibit, they still have time outside.”

Advocates are pushing the Bronx Zoo to fulfill its promise to shut down the elephant exhibit.

“They should do it now and send those elephants to a sanctuary,” said Byrne of PETA, which has been pressing the matter with the Wildlife Conservation Society, which owns the zoo.

But acting right now would be a financial risk.

“Zoos are concerned about a domino effect,” said animal advocate Stewart.

“Next year it’s polar bears, then grizzly bears, though Detroit got rid of their elephants and attendance is better than ever.”

Besides the potential loss of visitors, several obstacles must be overcome.

The zoo would have to find a suitable location, though there are two likely places: PAWS in California, where eight animals live on 115 acres, and the Elephant Sanctuary in Hohenwald, Tenn., which has 14 pachyderms and more than 2,000 acres.

Stewart estimated the cost of building three crates for the trio and trucking them to Tennessee at about $80,000.

“It’s quite a bit harder moving elephants that don’t travel that often — it’s stressful for them and it takes conditioning. You have to take precautions.

“And you worry about their health. They’d have to be quarantined for tuberculosis for a time. Putting a new elephant into a group that’s been together for a while is a risk. Climate is an issue, but if they’re in New York, they should be fine going anywhere.”

He thought transferring Happy, Patty and Maxine would be great for them — and not overly difficult to pull off.

The good news?

“Some of the most social elephants are the ones that were alone.”

Plotnik hopes for the best for his research darling — and saddened to hear of her circumstances. If Happy truly has a sense of self, she may also know loneliness.

“Elephants should not be kept isolated,” he said. “Their social welfare is a priority.”