A resident of the Sand Cove Apartments on Shell Boulevard in Foster City arrived home Tuesday evening to find his door ajar and someone inside the unit, police said.
The interrupted burglar told the resident to leave and was still inside while the resident reported the intruder to the Foster City Police Department.
Officers ordered the burglar to come out and arrested Brent Allen McDonald, 30, of San Francisco.
"The investigating officers discovered the suspect had several pieces of the victim's property in his possession, including a knife that he was carrying in a concealed manner in his waistband," the department said in a news release.
McDonald already had two warrants from the San Francisco Sheriff's Office, for committing battery on a person and for exhibiting a weapon in a threatening manner and illegally carrying a dirk or dagger.
He was booked into San Mateo County Jail on suspicion of felony residential burglary and illegally carrying a concealed dirk or dagger.