Patrons wait in long lines at the 2014 opening of the Horseshoe Casino in Baltimore. (Bill O'Leary/The Washington Post)

The two armed men wearing ski masks showed up at a home in Montgomery County, tied up two residents and demanded: “Where is the money?”

What may have seemed a random crime last fall — authorities now assert — was nothing of the sort.

The bandits had staked out a casino in Baltimore, identified a frequent gambler, attached a GPS tracker to his car, learned where he lived in Montgomery and made their move.

“Came in — guns, zip ties, duct tape — the whole deal,” Montgomery County prosecutor Curtis Zeager said during a recent court hearing after a suspect’s arrest. “Grabbed up $6,000 in cash.”

But the robbers were not the only ones to have put a GPS device on the gambler’s car.

Kevin Darnell Carroll (Montgomery County Police Department)

The bond hearing March 2, as well as arrest records filed in court, spell out a bizarre sequence of events leading up to the robbery that authorities say was committed by Kevin Darnell Carroll, 44, of Baltimore, and an accomplice who remains at large.

Among the details, the wife who lived at the Montgomery home — in the Darnestown-Germantown area — had hired a private investigator to keep tabs on her husband.

On Nov. 11, the private investigator tailed the husband to the casino where he had been going about six days a week and “was gambling with large sums,” according to the arrest warrant in the robbery.

After the husband went inside, the private investigator put his own GPS tracking device on the husband’s car. While the private investigator was still near the car, he saw another man crawling under it with a flashlight. Eventually, two GPS devices were on the husband’s car — the robbers’ and the investigator’s, according to the police.

The robbery occurred six days later.

Two occupants of the targeted home — a 21-year-old man and 14-year-old girl — went out to get something to eat, returned and fell victim to two men who slipped into the garage behind them.

The robbers pointed guns at the two young people, ordered them to the ground, zip-tied them and put duct tape over the girl’s mouth.

One robber then took the 21-year-old into the house, demanding money. The victim took the gunman to “various locations in the house where money was kept,” according to the arrest records.

[Has the bet on casino gambling in Baltimore been a bust?]

After the robbery, the victims freed themselves and called 911, police said.

At the scene, the victims’ mother pulled a detective aside and said she had hired a private investigator to follow her husband, and she told them about the investigator’s tracker.

Detectives later spoke to the investigator, who said that while the husband was in the casino, the investigator saw two men acting stealthily near the husband’s car, court files show.

On Monday, Montgomery police announced the arrest of Carroll in the case.

At the bond hearing, Zeager, the prosecutor, said Carroll “took a good amount of time to reconnoiter.” He said that Carroll and a partner — after hanging out at the Horseshoe Casino — knew what they would find at the gambler’s home.

“They see: ‘Okay, this guy is at the Horseshoe Casino a lot, and probably has a lot of cash around.’ And they’re right. He comes down here via the information from the tracker,” to commit the robbery, Zeager said.

Carroll’s attorney at the hearing, Staci Pipkin, said Carroll “steadfastly denies” any involvement.

Carroll has not had a conviction in 13 years, Pipkin said, and has been employed selling cars for more than five years and helps his disabled mother.

“He would like to get back to work and taking care of his mother,” Pipkin said.

A Montgomery County judge assigned Carroll a $125,000 bond, which he posted for his release. The second suspect remains at large.

In court, Pipkin said her client drives a different vehicle from any cars spotted in the garage by the private investigator.

“The private investigator went there and he sees someone else,” Pipkin said. “Someone else places a tracker on [the homeowner’s] vehicle. And the private investigator then places his own tracker on the vehicle.”

Six days later and 50 miles away in Montgomery County, two assailants entered the garage of the casino patron.

Crime scene investigators tested for DNA on zip ties, duct tape and the GPS tracker from the robbery site. They matched DNA from the duct tape to Carroll, according to the arrest records.

Police arrested Carroll last week and said they found in his home a ski mask and a gun they think were used in the robbery.

Carroll was charged with home invasion, armed robbery, assault and other counts, according to police. Police provided only a minor, vague description of an alleged accomplice.

In a written statement, Horseshoe Casino Baltimore said that providing “a safe and enjoyable environment” for patrons and employees “is our top priority.” The statement said that “on the rare occasion when someone violates a security policy, we work closely with law enforcement to ensure that [the] individual is not only removed from the property and issued a lifetime ban but also prosecuted to the full extent of the law.”