Hartley got a surprise Toro Rosso chance for this weekend's United States Grand Prix at Austin, with Carlos Sainz released to join Renault early and Pierre Gasly fighting for the Super Formula title at Suzuka following a two-race stint as Daniil Kvyat's replacement.

Red Bull backed Hartley's early single-seater career, which included a Formula Renault Eurocup title and third place in the 2008 British F3 season, but it dropped him during 2010.

He later switched to sportscars and eventually earned a factory Porsche LMP1 drive, winning this year's Le Mans 24 Hours and the 2015 WEC title alongside Mark Webber and Timo Bernhard.

Hartley revealed he got back in touch with Red Bull motorsport advisor Marko when he knew Porsche was quitting LMP1 after 2017.

"I called Helmut after the LMP1 programme was finishing, just to say 'if ever there is an opportunity I'm ready'," Hartley told Motorsport.com.

"He got the message and now this opprotunity came up at the last minute and quite out of the blue in some respects."

Hartley has had time in the Red Bull simulator in recent weeks - his first such running since a session with Mercedes in 2012 - and said he initially did not know his simulator recall was with a race seat in mind.

"First I did a simulator test and I didn't ask too many questions," he said. "They said 'come along' and I said 'OK'. I didn't really know there was a chance to be on the grid for Austin.

"It has come about very quickly. I didn't know too long before the media did, let's say that."

Asked if he had given up on ever getting to F1 as he became established in sportscars, Hartley replied: "When I spoke to people I said it was unrealistic, but the dream was always there.

"Did I believe it was really going to happen? Three or four years ago, no.

"Was I really convinced that I had a chance this year? The dream was there, but honestly at 27 when the age of the drivers is starting to get lower and lower, I wasn't sure.

"They are obviously taking a chance with me. They have obviously done their homework."

He added that he returned to the Red Bull fold "a much stronger and more rounded driver now" than when it dropped him.

"I went through some tough times," said Hartley. "Mentally I'm much stronger now. I don't make nearly so many mistakes. I am more prepared than ever as a racing driver."

Hartley, who is also in contention for a Ganassi IndyCar seat for 2018, said he did not "want to look that far ahead" when asked if he thought Austin could lead to a full-time Toro Rosso drive next year.