Miranda Lambert will be heard on the big screen this summer.

The country star co-penned a new song called “Two of a Crime” for the upcoming movie, “Hot Pursuit” starring Reese Witherspoon and Sofia Vergara. The odd-couple comedy is about a newbie police officer (Witherspoon) who is assigned to protect Vergara’s character from a drug cartel and corrupt cops.

Lambert revealed that the Oscar winner contacted her directly to contribute to the film’s soundtrack.

"Reese texted me and told me about the movie and wanted me to write something or sing or both. I got inspired," she told Ryan Seacrest. "It was a bit of a Thelma and Louise theme and that's totally up my alley. It is really so fun to be part of it."

The only instructions were that the song should have a “Southern and Latin flavor.”

More On This...

Lambert is nominated for Entertainer of the Year at this Sunday’s 50th Annual Academy of Country Music Awards. “Two of Crime” hits theaters on May 8.

WATCH: FOX411 Country: Miranda Lambert's lucky charm