A nurse and security guards have been injured after a brawl broke out between about 20 family members visiting a relative in a Sydney hospital.

Police had to be brought into the Royal Prince Alfred Hospital on Sunday night to help quell the melee.

Police say a fight broke out between two female relatives and the rest of the family group.

Hospital staff tried to break up the brawl before the group split and two separate fights broke out.

Security guards put two women in a hospital room with their relative before a male family member tried to enter the room, police said in a statement.