Sarah Hyland has been granted a three-year restraining order against her ex-boyfriend.

After initially obtaining a temporary restraining order against her boyfriend of 5 years, The Modern Family star has secured a permanent protection order against Matthew Prokop after claiming he assaulted her and threatened her life.

According to the order, obtained by who else but TMZ, Matthew must stay 100 yards away from Sarah, her house, her workplace, her dog Barkley Bixby (that's most important), and not own or possess a gun or ammunition otherwise he could risk going to jail.

The 23-year-old actress was granted a temporary restraining order against her ex-beau last month after accusing the 24-year-old actor of terrorising her verbally and physically during the last four years of their romance.

By way of example, Matthew allegedly pinned her against a car during an argument about her outfit in May before repeatedly calling her a "c**t" and choking her.

The Emmy Award-winner stated in the court documents: "His grip was so tight that I could not breathe or speak. I was scared and in fear for my life."

It was at this point that she drafted in her on-screen ma, Julie Bowen, to help break up with him.

Following their split, Sarah claimed her former boyfriend "relentlessly bombarded me with vile, threatening and emotionally disturbing texts and voice mails including his own suicide threats."

The former couple started dating after meeting while auditioning for High School Musical 3: Senior Year in 2008. They later starred together in the Disney Channel film 'Geek Charming' in 2011.