"The front row in Le Mans has been kind of a secret target, and we have been able to tick it off the list at our first attempt," he said. "It's not pole position, but it is totally fine.
"We knew we would have been fast enough, but in the end we weren't lucky enough to get a clear lap.
"Now we will focus on the race and try to avoid mistakes. I am proud of our team and wish everyone all the best."
Porsche vice-president Fritz Enzinger was equally pleased.
"I think it's amazing that we really made it to the front and second rows at Le Mans. This is more than we could expect. We did very well in qualifying."
Team principal Andreas Seidl added: "To me these grid positions are sensational and a great reward for two tough years.
"For the outside world it might be difficult to imagine how challenging it really was to build up everything from scratch, and we even managed these tricky qualifying situations here in Le Mans with all the interruptions pretty well.
"The qualifying result is a reward not only for the team here at the track, but also for the guys back home in Weissach."
Hartley found the qualifying experience frustrating at times.
"It was a tough session out there with slow-zones and red and yellow flags. It was a matter of luck who got a clear lap and who didn't, which I found a bit frustrating.
"But I think from the team's point of view it was a great effort. Second and fourth on the grid at the return of Porsche to the prototype class in Le Mans - this is fantastic."
Earlier Hartley said: "I think we have learned a lot from the day.
"When I started in motorsports, my objective was Formula 1. I landed in endurance in 2012 and this discipline has become a true passion for me.
"The human aspect of it is essential and your teammate is truly a teammate, and not an adversary.
"When you come from single-seaters and you start in endurance, it's a strange feeling to see another driver get in the car.
"In endurance, you have to reinforce the bond, help your teammate when he has a problem, it is a much more pleasant environment.
"I really love that."