A24 has bought North American rights to the thriller “The Stars at Noon,” starring Robert Pattinson and Margaret Qualley.

Claire Denis is attached to direct, and wrote the screenplay with Lea Mysius and Andrew Litvack, based on Denis Johnson’s 1986 novel.

The deal was announced Tuesday on the eve of the Berlin Film Festival, where Wild Bunch is launching international sales on the project. CAA Media Finance brokered the domestic deal. RT Features and Paris-based Curiosa Films are producing “The Stars at Noon.”

The film, set during the Nicaraguan Revolution in 1984, follows a mysterious English businessman and a headstrong American journalist who strike up a passionate romance. Their situation soon deteriorates and they attempt to escape the country, with only each other to trust and rely on.

Pattinson is currently shooting “The Batman” for Warner Bros. Denis’ credits include “35 Shots of Rum” and “High Life,” which also starred Pattinson and was bought by A24.

Qualley, who appeared in “Once Upon a Time in Hollywood” as a follower of Charles Manson, stars in the Berlin Film Festival opener “My Salinger Year.” She’s also attached to topline “A Head Full of Ghosts.”

Pattinson is repped by WME, Curtis Brown, 3 Arts and Sloane, Offer. Qualley is repped by UTA, Management 360 and Sloane, Offer. The news was first reported by Deadline Hollywood.