IRobot is best known for its friendly Roomba vacuum robot, but the company got its start making military robots, such as the PackBot, which is popular in war zones. Images from IRobot

When IRobot unveiled its Roomba vacuum cleaner robot in 2002, people went crazy for the dinner plate on wheels that zoomed across carpets sucking up dust and dirt.

It was cute. It sold millions of units. It marked the first mainstream household robot, like something straight out of the Jetsons.

But even back then the Bedford, Mass., company created by three MIT roboticists had its roots in a far murkier world: The defense industry.

Before the Roomba hit store shelves, other IRobot devices already were being deployed with U.S. troops. Another model could detect land mines. And IRobot’s PackBot – with tank treads and camera atop an extendable metal neck – searched for survivors in the ruins of the World Trade Center after the September 11th attacks.

Today, the maker of cute robotic vacuums is also the largest supplier of ground-based robots to the U.S. Department of Defense.

But IRobot last week announced it was ending its run as a defense contractor. The company said it plans to sell its defense and security business to Arlington Capital Partners, a private equity firm in Chevy Chase, Md., which has deep ties to the government contracting world. The price was up to $45 million, based on sales targets. A new name for the defense unit will be announced when the deal closes in the next few months, a spokesman said.

The sale allows the $800 million IRobot company to focus on selling vacuums and, more recently, robotic sweepers and mops to consumers.

The move follows pressure from Red Mountain Capital Partners, a firm that owns 6.1% of IRobot shares. In a Jan. 25 letter to IRobot’s board, Red Mountain threatened a proxy fight if the company didn’t spin off its defense unit.

The business of making warbots, as they are sometimes called, had become a drag on IRobot, with unit revenue flat from 2011 to 2014. At the same time, sales of its vacuum robots were strong, especially in newer markets such as China, where the mop bot proved especially popular.

IRobot’s problem is one familiar to many defense contractors after the many fat years fed by U.S. wars in Afghanistan and Iraq. Defense procurement is drying up and becoming more strict.

“The big buys are over,” said Larry Dickerson, senior defense analyst at Forecast International. “So if you’re going to get out the business, now is the time to do it.”

IRobot’s defense robots were perfect for U.S. soldiers contending with an insurgency and improvised explosive devices, Dickerson noted. Robots such as the $125,000 PackBot were rugged devices that allowed for close inspection of suspicious packages or rooms. The PackBot also could be equipped with detectors of chemical, biological and nuclear agents.

A newer IRobot device called FirstLook fits in the growing “throwbot” category – machines that can be thrown in a room or tight space and allow soldiers to see what is inside. The FirstLook weighs 5 pounds and stands just 4 inches tall. In December, the Navy ordered $4 million of the FirstLooks – at $20,000 each, that’s 200 units.

Other manufacturers of military ground robots include England-based Qinetiq and ReconRobotics in Edina, Minn.

But selling robots to both the government and consumers is difficult.

“They are very different audiences,” said Sean Bielat, who will take over as chief executive of IRobot's defense unit once it's spun off.

IRobot reported Thursday that it had $616.8 million in revenue in 2015, with $55 million coming from its defense unit. The company noted home robot sales were up 25 percent from a year ago, attributed to a new Roomba model and the addition of Target to its line of retailers.

Sales of its warbots were up too, by 21 percent.