Credit: Kevin Winter/Getty Images

American Idol‘s Jennifer Lopez is going to play an undercover cop on NBC.

The network has given a straight-to-series order to the drama Shades of Blue starring Lopez as a single mother and detective recruited to work undercover for the FBI’s anti-corruption task force.

The 13-episode order is from writer Adi Hasak (3 Days to Kill), who executive produces with Lopez and her fellow Idol colleague Ryan Seacrest, along with Nina Wass, Elaine Goldsmith-Thomas, and Benny Medina.

Her character, Harlee McCord, is further described as “part of a close-knit unit known for its conviction record, Harlee has become compromised by her colleagues — all of whom also pitch in to help her raise her daughter — and finds herself faced with the moral dilemma of working against her cop brothers in order to redeem herself.”

“Whether it’s producing, acting, singing or any of her other many entrepreneurial activities, Jennifer is an extraordinary talent and life force, and we’re delighted to be in business with her and Adi Hasak on this sophisticated show,” said NBC Entertainment president Jennifer Salke. “We’re especially excited that Jennifer is returning to her acting roots from such great movies as Out of Sight and we know that she will create this complicated character in a vivid way that will breathe new life into the cop show genre. Ryan Seacrest is part of the NBCU family and doing his first scripted drama series with us makes perfect sense.”