They’re the scourge of New York City, but on the other side of the world, rats have a different title — lifesaver. They’ve now become the most successful way to find land mines.

“I’ll tell you the truth . . . I never believed a rat could do that job. I thought rats were useless,” Soeun Prom says with a laugh.

But in 2015, Prom began working with Apopo, a Tanzania-based organization that trains rats to sniff out land mines in his native Cambodia — and since then he’s gained nothing but respect for the oft-maligned creatures.

“After I’d worked with them for one month, I thought, ‘Oh, they’re so smart,’ ” he said.

In countries such as Cambodia, Angola and Mozambique, rats with whimsical names like Uncle Albert, Maya Angelou and Jane Goodall have helped clear nearly 8½ square miles of land mine-stricken fields since Apopo was founded 20 years ago.

“We call them our hero rats every day,” says Dr. Cynthia Fast, who heads up training and behavioral research at Apopo’s headquarters at Sokoine University of Agriculture in Morogoro, Tanzania. “Everyone has such great respect for them. They really are pampered. [They’re] like a cross between a cat and a dog. They’re friendly and they’re furry and they’re cute.”

These aren’t just any old pizza-addicted subway rats, though.

Apopo works with African giant-pouched rats, which typically weigh between 2 and 3 pounds, and are highly intelligent with an acute sense of smell.

“They tend to be a little more social than what you normally think of with a rat,” Fast says. “Maybe because we start socializing them when they’re so young. They’re inquisitive about people.”

Much of the giant-pouched rat’s advantage in finding mines has to do with that olfactory superiority — but they’re also well suited for the harsh, dry heat of sub-Saharan Africa, where they’re trained. The rats are so light, they won’t set off buried explosives, and unlike dogs, they can bond with multiple handlers at a time.

They’re also quick little workers, capable of clearing 2,000 square feet in 20 minutes, which could take a human as much as four days.

“They’re a bit larger than a typical rat — maybe not a New York street rat — but they can cover more ground in a shorter amount of time,” Fast says.

The roughly nine-month training process begins when the rats are just old enough to open their eyes, around 5 weeks old.

“That’s when we train them to be around humans, and also be out in the bigger, scarier world,” Fast says.

The babies are exposed to an array of sights, smells and sounds — from the sweet aroma of flowers to the startling roar of a truck’s engine.

At the end of the first round of training, which lasts about two weeks, the rats need to be focused and unflappable, not at risk of trying to scurry away in the field.

“They have to be used to being handled and wearing a little harness, and not get distracted by all these little things in the world,” Fast says.

Once they’ve been socialized, they’re ready for the next step: click training. It starts out simple (and delicious) enough: A rat trainee hears a click, then receives an edible reward in the form of mashed avocados and peanuts. That process is repeated over and over until the rat learns to associate the click with a tasty treat.

At one point, trainers begin tucking TNT-scented paper into metal tea eggs displayed on a foil-covered table, which the rats must move toward before they hear the click sound that means it’s time for a food reward.

Eventually, the eggs are buried in a layer of soil, and the rats learn to scratch the dirt when they smell the eggs with TNT.

“They have to find at least five that are buried with no more than one false alarm, then they move off into our training field,” Fast says.

The training field holds more than 1,500 deactivated land mines buried in soil. With trainers, the rats scour a small area of the field at first, using their olfactory talents to sniff out the land mines that may or may not be lurking below the surface. Over time, the plot of land they must search gets larger.

“In those most advanced training stages, sometimes there will never even be a mine,” Fast explains.

Some rats catch on quickly, others require a bit more encouragement. They also have their own strategies as they scamper through the field.

“Some rats check every square inch of the field. They have high energy and are excitable,” Fast says. “You can tell when they’re sniffing around the air that if they were a dog, they’d be wagging their tail.”

But it’s hardly all work and no play at the training center. The rodents enjoy a rather leisurely schedule, working for about 20 minutes in the early morning before resting and exercising for the rest of the day.

Weekends are reserved for feasting: The rats get to pig out on avocados, tomatoes, dried fish, peanuts, chunks of watermelon, mango and corn.

“We take the weekend off and so do the rats,” Fast says. “They get this huge feast — they just stuff the food into their cheeks.”

To graduate from training, the rats must clear an area without missing any mines. Then the real work begins, and the critters are sent off to their assigned field locations.

That’s where people like Soeun Prom enter the picture.

Prom is the program officer for Apopo’s demining efforts in Cambodia, where the NGO has teamed up with the Cambodian Mine Action Centre, a local organization.

Cambodia is one of the most mine-infested countries in the world — the result of decades of civil war. More than 64,000 casualties have been attributed to land mines and other explosives left over from war, and the country currently has the highest ratio of mine amputees per capita in the world.

“The area that’s covered with land mines is still huge,” Prom explained, adding that the unexploded devices tend to impact farmers and those living in remote areas the most.

He’d hoped his country could be cleared of mines by 2025, but he expects the task will take longer.

“People living there are scared — they suffer a lot,” he said. “I’m very proud that Apopo has come to work in Cambodia. Within seven months we cleared around 800,000 square meters [8.6 million square feet] and found 305 items.”

There are currently 19 rats stationed in the Prasat Bakong District in northwest Cambodia, where they live in a two-story home with their handlers, who form close bonds with the creatures in their care.

“The rat is like their pet,” Prom said. “After they finish their field work, the rats will start to run behind their handler like a puppy.”

A typical day in the field begins early, with the rats leaving their home around 4:30 a.m. By 6 a.m. they’ve arrived in the minefields, and they’re ready to start searching land for explosives.

The field must first be cleared of vegetation, then divided up into boxes that the rats will be responsible for.

Human workers use metal detectors to create lanes for handlers to walk on as they work with the rats, which are tethered to ropes suspended between two people.

They work quickly, far faster than a human armed with a metal detector would be able to — and they’re more precise. “That’s mostly because rats don’t pick up the scent of objects that aren’t filled with TNT, and therefore, less time is wasted with false alarms,” Prom explains.

When rats find something suspicious, they’ll scratch the ground, as they’re taught to do in training. At that point, a team member will record that location, then a worker with a metal detector will search the area. If a mine is located, it’ll either be exploded on the spot, or removed from the earth and blown up in a safe area.

It’s dangerous work, but rewarding for the people who risk their lives to do it.

“They’re not scared, because they just want to see smiles on the people in the community after they clear the land,” Prom said.

And so far, no humans — or rats — working with Apopo have lost their lives in the process.

These remarkable rodents aren’t just good for land mine detection: Apopo is also training giant-pouched rats to identify patients with tuberculosis, a deadly disease that kills 1. 5 million people each year.

Catching the disease early in patients helps limit the spread of the infection to other people — and the rats can be more efficient at detecting it than lab workers with microscopes.

“It’s a second line of diagnosis,” Fast says. “Our rats have increased case detection [in the clinics we work with] by over 40 percent.”

Someday the giant-pouched rats may even be able to help detect other diseases, including cancer, says Apopo CEO Christophe Cox.

“We’re looking into that. It’s a challenging field, of course, but diseases have smells,” he explained.

The nonprofit is also researching ways that rats could be trained to detect illegally trafficked wildlife and perform search-and-rescue missions in buildings affected by earthquakes.

Pendo Msegu, a trainer and breeding coordinator with Apopo, who grew up in Tanzania, said she’s proud of her work with the “hero” rats, knowing that her labor is ultimately helping other people.

“I didn’t realize that rats could save human lives,” she says. “Even my family members, they’re proud of me.”