Jose Jimenez-Montejo was arrested after the incident, which occurred at about 3:30 a.m. behind a home at 1700 N. Petaluma Blvd., near the Petaluma River, police said.
After threatening to kill the victim, Jimenez-Montejo allegedly stabbed the victim, who was trying to flee the area, according to police.
The victim called 911 and was transported to a local hospital where he was treated and released for his injuries, according to police.
Police officers found and arrested Jimenez-Montejo shortly after the incident was reported, police said.
He was booked into Sonoma County Jail on charges of assault with a deadly weapon and making terrorist threats, and had his bail set at $20,000, according to police.