San Jose police Sgt. Heather Randol confirmed that McDonald, 29, was taken into custody early Sunday after officers responded to a call at 2:48 a.m. PT.
McDonald was jailed on felony domestic violence charges and was in the custody of the Santa Clara Sheriff's Department before posting bail Sunday afternoon.
He wouldn't discuss what happened with television news reporters who approached him after he posted bail.
"I can't say too much, not right now, but the truth will come out. Everybody knows the kind of person that I am," McDonald said. "I'm a good-hearted person."
Niners general manager Trent Baalke said in a statement Sunday that the team takes "such matters seriously," but is not commenting on the allegations involving McDonald without more information.
An NFL spokesman told ABC News that the league is aware of McDonald's arrest and is "looking into the matter."
The incident occurred on Bentley Ridge Drive, part of an upscale San Jose neighborhood. It is the same street where McDonald's teammate, star pass rusher Aldon Smith, was arrested for DUI following a single-car accident last September. Smith has been suspended nine games for multiple off-field incidents.
McDonald also has an arrest for DUI on his record in Santa Clara County in 2010.
Sunday's incident occurred less than three days after NFL commissioner Roger Goodell announced tougher penalties for players accused of domestic violence. Under the league's newly implemented personal conduct policy, a first domestic-violence offense will result in a six-game ban and a second in a lifetime ban from the NFL.
The new rules were announced Thursday in the wake of Goodell being widely criticized for giving Baltimore Ravens running back Ray Rice a two-game suspension for allegedly hitting the woman who is now his wife, knocking her unconscious.
Goodell told teams to distribute to all players a memo in which he writes: "Domestic violence and sexual assault are wrong. They are illegal. They are never acceptable and have no place in the NFL under any circumstances."
Former 49ers safety Donte Whitner, who now is with the Cleveland Browns, told the Sacramento Bee last year that San Francisco coach Jim Harbaugh told his team that violence against women would not be tolerated.
"He said that we can do anything in the world and we can come and talk to him and he'll forgive us except put our hands on women," Whitner told the Bee. "If you put your hand on a woman, then you're done in his book."
A third-round draft selection in 2007, McDonald has spent his entire career with the 49ers, recording 16.5 sacks in 101 games over parts of seven seasons. The 290-pound McDonald has started 45 regular-season games since Harbaugh began his tenure with the Niners in 2011.
The Associated Press contributed to this report.