Bobby Dwyer broke into the multi-occupancy property in Acocks Green in the early hours of September 28 after a dispute over a dog.
After gaining entry the 22-year-old started smashing up property before forcing his way into a bedroom.
Police were called to the scene of the disorder by terrified occupants of the home and discovered Dwyer raging outside.
He became abusive to officers and spat at one before they arrested him and took him into custody.
Birmingham Crown Court was told that Dwyer was not cooperative initially but police had managed to recover a large amount of evidence at the scene, including the machete he came armed with, a mobile phone he left behind and blood discovered on a window. He was also caught on CCTV approaching the property, as well as inside.
Dwyer, of no fixed abode, issued an early guilty plea to charges of aggravated burglary, criminal damage, possession of an offensive weapon and assaulting an emergency worker at Birmingham Crown Court and was sentenced to six years in prison.
DC Jennifer Horobin, from the High Harm team at Stechford, said: “This must have been terrifying for the people inside the property at the time.
"After he broke into the property and caused considerable damage he then spat at an officer before being arrested.
“We managed to gather compelling evidence and this led to his early guilty plea. We are pleased Dwyer is now serving time behind bars for his unacceptable actions.”