A police officer has a broken arm and four men face assault charges after an alleged violent home invasion in Sydney's inner-west overnight.

Shortly after midnight, a man, 25, was in the courtyard of a Petersham unit complex when four men allegedly entered the area and attacked him with iron bars.

Police claimed the man ran inside but the assailants, aged between 18 and 20, forced their way into the unit and started damaging it.

Inspector Natasha Fairfax said police were called and the alleged offenders fled on foot.

Three were arrested a short distance away, the fourth was taken into custody by highway patrol officers.

One patrol officer suffered a broken arm during the arrest and she required surgery.

The four men will face break-and-enter and assault charges at Parramatta Bail Court later today.