Two days after being arrested in a domestic violence case, former San Francisco 49ers lineman Ray McDonald was arrested again Wednesday, this time on a charge of violating a restraining order, police said.

About 2:52 p.m., Ray McDonald, 30, was determined to have been at an unspecified residence in Santa Clara in violation of a restraining order, police said.

Detectives found McDonald at a Togo’s Sandwiches at 2203 Tasman Drive in Santa Clara at 5:35 p.m. and took him into custody, authorities said.

He was arrested without incident and posted $5,000 bail late Wednesday night. As he left Santa Clara County Jail in San Jose, he brushed off news reporters.

Asked what happened, he said, “I don’t know. Warriors win today? Shouldn’t you be going to that?” Prodded further, he said, “Man, why don’t y’all go home or something:? Jesus Christ.”

On Memorial Day, Santa Clara police had arrested McDonald on suspicion of domestic violence and child endangerment in the attack of a woman holding a baby, prompting the Chicago Bears to release him after less than three months on the team, officials said.

Police did not release details, but scanner recordings reviewed by The Chronicle indicate that officers were sent to an apartment on Carlyle Court about 3:45 a.m. Monday by the alleged victim’s mother. Dispatchers said the mother told them that McDonald, her daughter’s boyfriend, “was being violent” and had been drinking.

McDonald was arrested about 7:30 a.m. at a San Jose home owned by Justin Smith, the 49ers’ defensive tackle who retired last week. McDonald posted $15,000 later in the day and declined to speak to reporters as he got into a taxi. His attorney has told reporters that no physical contact was made.

The arrests this week are the latest in a spate of incidents that have led to law-enforcement scrutiny of McDonald.

In August, he was arrested on suspicion of felony domestic violence against his then-fiancee, but charges were not filed. It is unclear if that woman is the same person involved in the current incident. The first incident took place during a 30th birthday party that McDonald had thrown for himself.

In December, San Jose police said they were investigating McDonald for an alleged sexual assault. The alleged victim was drinking at a San Jose bar with McDonald and other friends before going to his house, police said. The woman said she was near the pool when she fell, hit her head and then woke up the next morning naked in bed with McDonald, authorities said. McDonald has sued the woman for defamation.

In December, the 49ers cited a “pattern of poor decision-making” in releasing McDonald, who listed his home on Bentley Ridge Drive in San Jose for sale in January.

In March, he signed with the Chicago Bears.

Henry K. Lee is a San Francisco Chronicle staff writer. E-mail: hlee@sfchronicle.com

Twitter: @henryklee