THE war between LeAnn Rimes and hubby Eddie Cibrian’s ex-wife has taken a dramatic new turn!

Sources say LeAnn be­lieves Eddie’s ex, Brandi Glanville of reality TV’s “The Real Housewives of Beverly Hills,” is spiraling out of control, and she’s urging Eddie to seek primary custody of his and Brandi’s sons, Mason, 10, and Jake, 6.

“LeAnn doesn’t feel she’s being petty or mean,” a friend told The ENQUIRER.

“She only has the boy’s best interests at heart. She’s told Eddie that, at this point, his sons should be with them while Brandi goes her own wild way.”

The “Blue” singer, 31, was appalled at 41-year-old Brandi’s recent com­ment that she “wanted to be molested as a child,” said the friend.

LeAnn – whose romance with former soap hunk Eddie ended his nine-year marriage to Brandi – is also disgusted with Brandi’s boozy on-air antics, added the friend.

“Brandi was so hammered that she practically had to be carried out of her own birthday party last fall,” noted the source. “That’s just not a good environment for her kids.”

Meanwhile, Brandi has repeatedly blasted LeAnn for calling her sons “my boys,” and complained about LeAnn constantly sharing her outings with Mason and Jake on social media websites.

“Brandi would never, ever entertain the notion of LeAnn getting legal stand­ing over her boys,” declared another source. “That’s a pipe dream on LeAnn’s part.”

And Eddie, 40, has told LeAnn that a long, drawn-out custody battle would be worse for the youngsters, according to a pal.

“He says Brandi is more of a danger to herself than to their sons, and that de­spite her crazy behavior, she’s a decent mom,” the source told The ENQUIRER.

But LeAnn doesn’t seem likely to back down. “LeAnn’s main concern is the boys,” said the source. “She’s grown to love them as if they were her own.”