Around 8 p.m. on a recent night outside the offices of Knightscope, a robotics startup based in the heart of Silicon Valley, a middle-aged man allegedly toppled a five-foot tall, 300-pound robot to the ground.

The security robot, called K5, had been circling the front parking lot on patrol, as it does every day. After the attack, the machine — which looks like the love child of R2-D2 and a Dalek from "Doctor Who" — sounded an alarm and alerted employees inside to the incident.

Knightscope employees detained the man and called the police. The man, who police said smelled strongly of alcohol, has since been arrested on prowling and public intoxication charges. K5 is happily back at work.

Bill Santana Li, CEO of Knightscope, tells Business Insider there's a lesson to be learned from the events on April 19.

"Don't mess with a K5," Li says.

Founded in 2013, Knightscope makes autonomous crime-fighting robots that patrol malls, sports arenas, and corporate campuses that belong to tech companies like Microsoft, Uber (which Fusion first reported and Li declined to confirm), and Juniper Networks. Knightscope rents out the machines for $7 an hour — less than a human security guard's hourly salary.

The Sacramento Kings put a K5 to work keeping its stadium safe. Knightscope

The robots don't fight back against humans. But using equipment like lasers, a thermal camera, and GPS, the machines can detect sounds a variety of sounds — cars honking, glass breaking, and people screaming — and scan up to 300 license plates per minute. When the K5 senses criminal activity, it alerts human authorities (usually Knightscope or the customer).

Their goal is to give human security guards "superhuman" eyes and ears, rather than replace them, Li says.

Though the 300-pound robots aren't weaponized, they can still do damage. Knightscope made headlines in 2016 when a K5 allegedly ran over a toddler's foot while on patrol outside a mall in Palo Alto, California. The boy's foot swelled and he got a scrape on his leg, though he was otherwise fine, ABC7 News reported. A handful of parents took to social media to rail against the use of robotics in mall security.

Knightscope made news again in April when a K5 got in a tussle with a man outside the company headquarters.

"The robot did what it was supposed to do in an emergency. It understood that the situation was anomalous, sounded the alarms, and reported the incident," Stacy Dean Stephens, vice president of marketing and sales at Knightscope, said in a statement. "This incident speaks to the core of what Knightscope is all about: humans and robots working together to prevent crime."

A K5 patrols the perimeter of a Microsoft office. Knightscope

The company has 19 clients across five US states. Most customers put the robots to work patrolling parking lots and office buildings.

The outcomes vary. In the last month, Li says Knightscope has helped a client work with local law enforcement to identify and arrest a vandalism suspect. Another client uses Knightscope to detect and report when someone is abusing a parking spot reserved for expectant mothers.

The real-life "RoboCop" may also help prevent crime, according to Li. "If I put a marked law enforcement vehicle in front of your home or your office, criminal behavior changes," he says. (Increased police presence can reduce crime, though this is not always the case.)

A K5 patrols the parking lot outside a Microsoft office. Knightscope

Most security guards in America undergo a background check and receive several hours of training. In California, they must be licensed. But a hodgepodge of rules and regulations across state lines leads to many private security guards entering the industry with little training or oversight. The results can be tragic, a year-long investigation by The Center for Investigative Reporting and CNN found.

A robot makes data-driven decisions based on input from the environment. It does what it's told (which could yield negative outcomes if the robot was hacked by someone with malicious intent). It never has an attitude or calls in sick.

Some customers have really taken to their bots. One company issued their robot an employee badge, Li says. The K5 machines at cybersecurity company ForeScout share a Twitter account.

Knightscope is eyeing an expansion to a college campus, a movie studio, and a law enforcement office later this year. Li sees a "huge opportunity" to make schools more secure through technology. Robots might detect suspicious activity sooner than a human, and because they're cheaper to deploy than humans, they could be placed all around a campus.

Li, a former executive at Ford, expects robotics to play a major role in the security industry.

"I think [robotics] will turn the world upside down," Li says.

Update: A previous version of this article credited a statement from Stacy Dean Stephens, vice president of marketing and sales at Knightscope, to Noe Sacoco, who consults for the company.