Bank robbers escaping with their ill-gotten loot usually try to get as far away from the bank, and the law, as possible.

Police said Edwin Sanchez went 377 feet.

The 24-year-old was captured less than nine minutes after police said he walked into a TD Bank branch at 801 17th St. in Northwest Washington on Wednesday afternoon and walked out with $1,160 in plastic bags.

Police said they found him a little later sitting in a McDonald's restaurant less than a block away at 750 17th St. NW. Court documents say he had a knife and money with him.

"He stated that he knew why law enforcement was there," prosecutors said in an affidavit filed in federal court charging Sanchez with one count of armed bank robbery.

Sanchez was being detained Thursday, and a court docket does not indicate a date for his next hearing. A defense attorney was not listed in the file.

Police said the robbery occurred about 1:20 p.m., when Sanchez handed a teller a note that said, "Stay calm, it's an armed robbery, put all the money in a bag." At one point, the court documents say, he pulled a knife from a bag.

Police said that he got two bags full of money — with two GPS-tracking devices hidden in the bills — and that he walked out of the bank and headed south on 17th Street. Authorities said he crossed H Street and went into the McDonald's across the street from the Renwick Gallery, a walk that typically takes just a few minutes.

Uniformed officers from the U.S. Secret Service found Sanchez inside the restaurant at 1:29 p.m., police said. The court documents do not say whether authorities tracked Sanchez using the GPS devices; an FBI spokeswoman declined to comment.