Amazon will partner with Lionsgate to distribute “The Big Sick,” after snapping up the Kumail Nanjiani comedy in a big deal out of the Sundance Film Festival.

“The Big Sick” will open in limited release on June 23, 2017, before opening in wide release on July 14, 2017. Amazon outbid a number of major studios to land the rights to the film, eventually paying $12 million in the second-biggest deal out of Sundance.

Reviewers liked “The Big Sick,” with Variety‘s Geoff Berkshire praising it as “a film that’s by turns romantic, rueful, and hilarious.”

Nanjiani is best known for his standup and for his work on “Silicon Valley.” He stars in the film as a Pakistani comic whose relationship with a graduate student (Zoe Kazan) is threatened by cultural differences and a health crisis. Holly Hunter and Ray Romano co-star as Kazan’s parents. Nanjiani and his wife Emily V. Gordon wrote the screenplay, drawing on their own lives.

Michael Showalter (“Wet Hot American Summer”) directed the film, with Judd Apatow and Barry Mendel producing.

“The Big Sick” will face some tough competition when it goes wide. That weekend marks the release of “War for the Planet of the Apes”; “Bad Dads,” a spin-off from “Bad Moms”; and “Midnight Sun,” a romantic drama.