Sony Pictures Classics aimed for a deft counterprogramming move in releasing Woody Allen’s “Midnight in Paris” the same weekend as “Pirates of the Caribbean: On Stranger Tides.”

The gambit paid off handsomely with “Paris” scoring the year’s best opening per-screen average: $96,468 from six locations.

The film, which took in an estimated $578,805, stands as Allen’s best-ever opening per screen, and it even beat last year’s top per-screen player, “The King’s Speech,” which opened Thanksgiving weekend with an average of $88,863.

Michael Barker, co-prexy of SPC, said the base of Allen film fans was a significant factor in finding traction vs. “Pirates,” particularly because of Allen’s popularity among filmgoers in New York and L.A.

“We purposefully went opposite ‘Pirates’ because we thought we would have free range in those cities,” Barker said.

Barker described the pic’s Cannes bow as key in launching the film this weekend, saying, “To have a big sendoff like Cannes was the perfect premiere platform for this particular film.”

Specialty pics, such as last year’s “The Kids Are All Right,” have proved to be successful counterprogramming to the summer’s tentpole fare.

With “Pirates” the only wide release over the frame, “Paris” had a well-timed springboard leading into Memorial Day weekend. SPC plans to kickstart domestic expansion starting Friday.

“We felt we could hold our own this week,” Barker said. “I think the opening weekend confirms this will be one of the major summer movies to see.”