The pre-embryos were created while the two actors were together, and a custody battle has ensued since their split.
Vergara, now 48, filed legal documents in 2017 hoping to block Loeb, now 45, from being able to use the embryos without her consent.
On Tuesday, a Los Angeles court granted the "Modern Family" alum a Permanent Injunction, blocking Loeb from creating "a child without the explicit written permission of the other person," according to court docs obtained by People magazine.
Reps for Vergara did not immediately respond to Fox News' request for comment.
"The judge was clearly influenced by Hollywood, which is a pattern I expose in my upcoming film Roe v. Wade on April 2nd," Loeb said in a statement to Fox News. "It’s sad that Sofia, a devout Catholic, would intentionally create babies just to kill them."
Court records indicate that the pair had previously signed a document at the fertility clinic stating that both Loeb and Vergara had to consent to the use of the embryos, the outlet reports.
Loeb claimed that he signed the document under "duress," but the court determined that the form "is not void or voidable based on Defendant Loeb's duress defense as to its execution."
He also previously claimed that he and Vergara had an "oral agreement" regarding the use of the pre-embryos, but the court found no "material fact" supporting that claim.
Loeb has also tried to obtain custody of the embryos through the Louisana court, though the case was dismissed in January.
In early February, Loeb told Fox News that he planned to appeal the court's ruling in favor of Vergara and that he is focused on releasing the film "Roe v. Wade," which he co-wrote and directed.
Vergara is now married to actor Joe Manganiello, whom she wed in late 2015. She has a 28-year-old son, Manolo, from a previous relationship.