Anchoring a row of family photos in Joseph Tector’s office is a framed, autographed picture of Baby Fae, the California newborn who made headlines in 1984 when she received a baboon’s heart to replace her own malfunctioning organ.

It’s inscribed “To Joe” by Leonard L. Bailey, the surgeon who turned to the monkey heart as the only option to keep his patient alive. Bailey snapped the picture about five days after the operation, while Stephanie Fae Beauclair was sleeping. A strip of surgical tape runs down the center of her chest from neck to diaper, marking the incision line where her rib cage was pulled apart to make the swap. Baby Fae would die less than three weeks later.

It’s an unsettling image to come upon while glancing over snapshots of someone’s dutifully smiling children. But to Tector, who was 19 at the time of Baby Fae’s surgery, the cross-species organ transplant was the most inspiring thing he’d ever heard of. “I remember where I was when the news broke,” he says. “At that moment I knew exactly what I wanted to do with my life.” What he wanted to do with his life, though he may not have articulated it precisely this way, was to become a surgeon-scientist trying to crack the problem of xenotransplantation — the placing of animal organs into human bodies.

Should you ever find yourself in need of a replacement for a vital organ, your ability to receive one will depend on some factors that have nothing to do with how badly you need that heart or lung or pancreas. Your age and blood type will figure, as will your ability to afford the immunosuppressant drugs and lifelong care needed to keep the organ functioning. If your lucky day ever comes, it will come only because someone else had an extremely unlucky day: A healthy and immune-compatible donor will have died in a way that leaves a healthy target organ unscathed.

But there is a chance that your lucky day will never come — that you’ll become one of the 20 Americans who die each day waiting for an organ. Indeed, forces that improve American health in other ways threaten to make the shortage of transplant organs even more acute: Safer vehicles cut into supply; longer life spans exacerbate demand. Even though 58 percent of adults in the United States have registered as donors, demand still outpaces supply and most likely always will.

While Tector worked his way through medical school, his hero Bailey continued his pioneering research in cross-species organ transplants, conducting dozens of transplants in and among baboons, sheep and goats. Large primates such as apes and chimpanzees, however closely matched they may be to us genetically, turned out to be a poor option for a sustainable organ-donation solution; they breed slowly and are in many cases endangered. But there is one abundant and quick-breeding species that in crucial respects bears an almost uncomfortable resemblance to humans: Sus scrofa domesticus, the common pig. Pigs gestate in less than four months, reach sexual maturity in five or six months and produce large litters. A 150-pound pig is uncannily humanlike in organ size and function.

Alas, in terms of our immune systems, pigs and humans are very different. A surgeon can’t just sew a pig organ into a human and expect it to work, because of molecular incompatibilities that developed since our ancestry diverged about 90 million years ago. Scientists have spent the decades since Baby Fae’s baboon-heart transplant working to comprehend the mechanisms that guide the human immune system to distinguish friend from foe, and to persuade it to regard the pig as friend.

Tector did in fact turn himself into one of those scientists: He is the director of the University of Alabama at Birmingham’s Xenotransplant Program. And today, 34 years after Baby Fae’s death, he and others on the xenotransplantation frontier believe they are on the cusp of delivering on Bailey’s promise, of creating a future in which designer swine, raised in pathogen-free indoor farms, will serve as spare-parts factories for our ailing, aging bodies.

“The joke about xenotransplantation is that it’s always just around the corner, and it always will be,” says Parsia Vagefi, the chief of surgical transplantation at the University of Texas Southwestern Medical Center in Dallas. “But recent progress has been so remarkable that for first time it feels like we’re on the verge of a definitive solution to the organ crisis.”

One consequence of xenotransplantation being always just around the corner is that pigs have been quietly insinuating their way into our bodies for some time now. Their pancreas glands have been used to make some types of insulin, and their intestinal tissue has been used to make the blood thinner heparin. Cardiac surgeons reach for pig heart valves to replace leaky and hardened human plumbing, and eye surgeons have affixed pig corneas to damaged human eyes. But a major organ — something that beats or filters or secretes just as well as it did for its donor — presents far greater challenges. Unless the recipient’s immune system is effectively deceived or suppressed, the incoming organ is destined for a very fleeting second act.

Since the 1980s, the immunologist David Sachs, then with Harvard University and now with Columbia University Medical Center, has been exploring ways to overcome the immune-system incompatibility at the heart of the xenotransplantation challenge. At some point deep in our evolutionary past, humans and other Old World primates switched off genes that produce the alpha-1,3-galactosyltransferase (alpha-gal) enzyme, which is still functional in most other species that have immune systems. Because the alpha-gal antigen is common in the environment, we produce antibodies against alpha-gal when we encounter it in our guts as babies. These anti-gal antibodies are a big part of the reason we reject ordinary pig tissue after transplantation. Sachs figured that if he could eliminate alpha-gal from the pig genome, problem solved.

The 1996 birth of Dolly the sheep gave Sachs an opening. Using a similar cloning method, he was able to slip a mutation that eliminated this enzyme into a line of specially inbred miniature swine. The new gal knockout (GalT-KO) pigs boosted the survival of pig organs in primates from minutes to weeks, a huge breakthrough. But weeks is not life; alpha-gal problem solved turned out not to fully solve the immune-rejection problem.

At around this time, the Swiss biotechnology giant Novartis, the maker of the immunosuppressant drug cyclosporine, began pouring funding into promising xenotransplantation research at university and private labs. “We were in the transplant wards, so we understood how devastating it is to have patients withering away waiting for an organ that never became available,” says Geoff MacKay, who was on the executive team responsible for Novartis’s transplant immunology programs at the time. According to MacKay, Novartis put “north of $1 billion” into xenotransplantation research.

But in 1998, a research team at Massachusetts General Hospital detected porcine endogenous retroviruses (known by the memorable acronym PERVs) scattered throughout the pig genome. In the age of mad cow disease and on the heels of the AIDS epidemic, there was, Sachs says, “a lot of anxiety about the possibility that we might be introducing a new pandemic, another AIDS virus or something.” Funding dried up.

In 2013, a 27-year-old Harvard graduate student named Luhan Yang co-authored a study that demonstrated how the genome-editing tool known as Crispr-Cas9 could slice through mammalian genes and edit sequences to remove some characteristics and alter others. Yang had been a science superstar in her native China; as a high school senior, she brought home a gold medal from the International Biology Olympiad. “In my home country,” she says, “millions of people need organ transplants, and most of them will die before they can get one. According to Buddhism, it’s good to die with a full body, so there’s very little donation culture.” This, Yang decided, would be the challenge she would turn Crispr’s newly demonstrated power to addressing.

Yang assembled a team and co-founded the biotech company eGenesis with the renowned bioengineer George Church, her mentor at Harvard; they quickly raised $38 million in seed capital. But it soon became evident that it would take more than a handful of gene edits to knock the endogenous viruses out of the pig genome. “The initial data was very discouraging,” Yang says. “The cells either died or only had very low targeting efficiency.” In 2015, Yang’s team finally succeeded in snipping out all 62 copies of the PERV gene in pig-kidney cells growing in lab dishes — an accomplishment that still holds the record for the most single-cell modifications.

It worked in a petri dish, but it was still unclear whether a viable pig could be produced after such extensive editing. Working with collaborators in Denmark and China, Yang’s team developed a technique to edit genetically normal cells from a living pig, then embed the DNA-containing nuclei of these modified cells into egg cells taken from the ovaries of a normal pig. A few months later, the team witnessed the birth of the first pig born without the endogenous viruses. They named it Laika, after the first dog in space.

With the PERV gene knocked out of their pigs, Yang and her team are experimenting with knocking in dozens of human genes to make the organs more humanlike: Some would buffer the pig tissue from assault by the human immune system; others would tweak its coagulation system to diminish the risk of clotting.

The ability to manipulate so many genes in one interaction has opened up myriad possibilities for researchers and quickened the pace of innovation. But Crispr gene editing can be imprecise: It can sometimes clip DNA in the wrong spot, potentially wiping out tumor-suppression genes in pig donors or, worse, human recipients. Tector’s strategy is to use as few gene edits as he can — he has settled on a triple-knockout pig — to minimize but not eliminate the rejection risk, then employ available immunosuppressive drugs to bridge the smaller compatibility gaps. “There are so many unknowns about genetic engineering that regulators are going to want to go into this in a stepwise fashion,” he says. “The simpler we can make it, the better.”

Catalyzed by Crispr, what had looked like a moonshot half a decade ago is starting to look more like a very methodical gold rush. Pharmaceutical upstart United Therapeutics, founded by the satellite-radio entrepreneur Martine Rothblatt, has helped rejuvenate the field, sinking millions into promising programs. Rothblatt has said she anticipates “delivering hundreds of organs a day.” Pigs from a subsidiary of the company, Revivicor, were used by a team in Maryland to keep a pig heart beating in a baboon for 945 days.

After years of setbacks, the past two years have seen a cascade of record-breaking xenotransplants using primate models, and researchers are working with regulators to prepare for clinical trials with humans. The first pig-to-human skin graft using live cells is set to take place this month in Boston. At the same time, Tector is readying a clinical trial in which he will install his triple-knockout pigs’ kidneys in dialysis patients who are unlikely to be considered for human-donor organs.

If that experiment fails, the recipients can return to dialysis. If it succeeds, it will, like most approaches on the horizon, be in no small part from the influence of a heavy regimen of immunosuppressant drugs whose substantial side effects are tolerated by transplant patients as part of the trade-off required to stay alive. Immunosuppressant drugs have advanced tremendously over the past few years, but many eminent xenotransplantation scientists regard the “brute-force immunotherapy” approach as stopgap until researchers perfect a more elegant approach called tolerance induction — essentially a re-education campaign for the immune system that convinces it to perceive the incoming organ as “self.”

The farm looks, at first glance, much like any number of other hilltop farms in central Massachusetts. Only when you get out of the car do you begin to notice the peculiarities: the cinder-block barn’s bricked-in windows, the security fencing, the monster-breath sound of industrial fans pulling air through superfine HEPA filters. This is what’s known as a designated pathogen-free pig facility, and it’s where David Sachs, the Columbia University immunologist who created the GalT-KO pig back in the late ’90s, maintains a herd of about 100 pigs specially inbred to be optimized for tolerance-induction research.

The buildings are biosealed and pressurized to protect their porcine inhabitants from environmental pathogens such as viruses, fungi and bacteria. Inside are animal pens, a meticulously organized laboratory and an operating room. To keep the animals pathogen-free, selected pigs are born inside the facility via cesarean section and then maintained as a closed herd. Subsequent generations will be bred from the progenitor animals inside the facility, a little more than an hour’s drive from Massachusetts General Hospital’s Transplant Center.

Sachs sought out his original pigs from herds whose ancestors had escaped from European settlers in the southern Rocky Mountains and the Andes. Domestic swine can grow to more than 1,000 pounds, but centuries in the harsher climate had selected out the smaller pigs that proved better able to survive the mountain winters. Their miniaturized bodies, and the organs inside, are about the same size as a human’s. After more than 20 generations in captivity, each newborn pig here will be genetically very similar to the others in its generation. “These pigs,” Sachs says, “are very likely the most inbred large animals on Earth.”

That genetic uniformity, as well as the absence of pathogens, makes his pigs ideal for an impending study in which researchers will try to induce tolerance by adding part of the recipient’s immune system to that of the donor, via bone-marrow and stem-cell transplants, before the transplant operation. The “mixed chimera” experiment is modeled on a human-to-human experiment in which seven out of 10 patients were able to be taken off immunosuppressants permanently. “We’ve shown that it’s possible between humans,” Sachs says. “There’s a high likelihood of it being good for xenotransplants too.”

When I visited the facility, the newest member of Sachs’s herd had been born just eight days earlier. As I watched this perky, roly-poly creature nose a ball around its small enclosure, I was suddenly struck by the recognition of what I was looking at: a Sus scrofa domesticus that might someday become, in a strange and partial way, a Homo sapiens. The organs inside this little pig — or perhaps more realistically, those of its progeny — could someday find their way inside me or you or one of our descendants. If so, we will be much the better off for it, even if we cannot say the same for the pig.