MILWAUKEE - APRIL 16:  Republican Presidential hopeful Senator John McCain (R-AZ) attends the Wisconsin Economic Summit at Bucyrus International Inc. April 16, 2008 in Milwaukee, Wisconsin. McCain spoke about economic issues with leaders of local and international businesses.  (Photo by Darren Hauck/Getty Images)
PHOTO: Darren Hauck/Getty Images
MILWAUKEE - APRIL 16: Republican Presidential hopeful Senator John McCain (R-AZ) attends the Wisconsin Economic Summit at Bucyrus International Inc. April 16, 2008 in Milwaukee, Wisconsin. McCain spoke about economic issues with leaders of local and international businesses. (Photo by Darren Hauck/Getty Images)
Now playing
00:57
McCain: Cruz's eligibility is a 'legitimate question'
PHOTO: Twitter / @smashracismdc
Now playing
01:50
Cruz swarmed by protesters at DC restaurant
ted cruz beto o
PHOTO: Pool
ted cruz beto o'rourke split
Now playing
02:55
Ted Cruz, Beto O'Rourke spar in first debate
Senator Ted Cruz at a debate in Dallas, Texas.
PHOTO: Pool
Senator Ted Cruz at a debate in Dallas, Texas.
Now playing
01:20
Ted Cruz: Americans are 'Dreamers' also
BOONE, IA - JANUARY 4:   Republican presidential candidate U.S. Sen. Ted Cruz (R-TX) visits King
PHOTO: Aaron P. Bernstein/Getty Images North America/Getty Images
BOONE, IA - JANUARY 4: Republican presidential candidate U.S. Sen. Ted Cruz (R-TX) visits King's Christian Bookstore on January 4, 2016 in Boone, Iowa. Cruz began a six-day bus tour of Iowa ahead of the state's February 1, caucuses. (Photo by Aaron P. Bernstein/Getty Images)
Now playing
02:06
Ted Cruz speechless for 18 seconds after question
Facebook CEO Mark Zuckerberg arrives to testify before a joint hearing of the Commerce and Judiciary Committees on Capitol Hill in Washington, Tuesday, April 10, 2018, about the use of Facebook data to target American voters in the 2016 election. (AP Photo/Pablo Martinez Monsivais)
PHOTO: Pablo Martinez Monsivais/AP
Facebook CEO Mark Zuckerberg arrives to testify before a joint hearing of the Commerce and Judiciary Committees on Capitol Hill in Washington, Tuesday, April 10, 2018, about the use of Facebook data to target American voters in the 2016 election. (AP Photo/Pablo Martinez Monsivais)
Now playing
02:22
Cruz presses Zuckerberg on Facebook politics
Cuomo Cruz Split
Cuomo Cruz Split
Now playing
02:49
Cuomo presses Ted Cruz on his name change
ted cruz cpac gun sot _00000000.jpg
ted cruz cpac gun sot _00000000.jpg
Now playing
01:00
Ted Cruz: We should target criminals
ted cruz comments on 2013 shut down sot  _00001621.jpg
PHOTO: CNN
ted cruz comments on 2013 shut down sot _00001621.jpg
Now playing
01:40
Cruz: I have consistently opposed shutdowns
PHOTO: CNN
Now playing
00:55
Cruz: Grief after shooting staggers the mind
PHOTO: CNN
Now playing
01:37
Ted Cruz on the porn tweet: 'It was not me'
WASHINGTON, DC - MARCH 20:  U.S. Sen. Ted Cruz (R-TX) speaks during the first day of the Supreme Court confirmation hearing for Judge Neil Gorsuch before the Senate Judiciary Committee in the Hart Senate Office Building on Capitol Hill March 20, 2017 in Washington, DC.
PHOTO: Justin Sullivan/Getty Images
WASHINGTON, DC - MARCH 20: U.S. Sen. Ted Cruz (R-TX) speaks during the first day of the Supreme Court confirmation hearing for Judge Neil Gorsuch before the Senate Judiciary Committee in the Hart Senate Office Building on Capitol Hill March 20, 2017 in Washington, DC.
Now playing
01:39
Ted Cruz on health care: The math is simple
ted cruz sex toys dana bash intv sot_00003507.jpg
ted cruz sex toys dana bash intv sot_00003507.jpg
Now playing
01:13
Ted Cruz: The left seems obsessed with sex
PHOTO: CNN
Now playing
00:51
Porn video 'like' removed from Cruz's Twitter
cruz health care sot
PHOTO: CNN
cruz health care sot
Now playing
01:15
Cruz: Senators will face tough questions
ac zeleny who is ted cruz_00005407.jpg
ac zeleny who is ted cruz_00005407.jpg
Now playing
03:09
Who is Ted Cruz?

Story highlights

John McCain called Canada-born Ted Cruz's eligibility for the presidency a "legitimate question"

McCain himself was born outside the mainland United States but was the 2008 GOP nominee

(CNN) —  

Ted Cruz’s explanation for why John McCain is questioning his eligibility to become president: McCain secretly supports Marco Rubio for the Republican nomination.

“Everybody knows John McCain is going to endorse Marco Rubio,” Cruz told reporters Thursday when asked about how the Arizona senator had brought up whether his birthplace would make him ineligible for running for president.

“Their foreign policies are almost identical. Their immigration policies are identical,” Cruz said. “So it’s no surprise that people who are supporting other candidates in this race are going to jump on the silly Attacks that occur as we get closer and closer to the election.”

Rubio has earned more establishment Republican support than Cruz, but McCain has not endorsed the Florida senator in the 2016 GOP presidential race – instead holding off on supporting another candidate after his preference, South Carolina Sen. Lindsey Graham, dropped out.

Early Thursday evening, a McCain spokeswoman said he will not be endorsing a primary candidate at this point in the race.

Cruz’s comments come after McCain said it’s “worth looking into” whether the Texas senator is eligible to run for president, since he was born in Canada.

In an interview Wednesday on Phoenix CBS affiliate KFYI, McCain said the questions raised by Republican presidential front-runner Donald Trump over Cruz’s eligibility are legitimate.

“I think there is a question. I’m not a constitutional scholar on that, but I think it’s worth looking into. I don’t think it’s illegitimate to look into it,” McCain said.

On Thursday, Trump again hit Cruz and referenced McCain’s comments.

“It was a very wise move that Ted Cruz renounced his Canadian citizenship 18 months ago. Senator John McCain is certainly no friend of Ted!,” Trump tweeted.

McCain has relished taking occasional shots at Cruz. The two have never been friendly – with McCain once describing Cruz and his allies as the Senate’s “wacko birds.”

McCain himself was born outside the U.S. mainland, in the Panama Canal Zone – a military base where his father was then stationed.

Another Arizona senator, 1964 Republican presidential nominee Barry Goldwater, had set the precedent when the Supreme Court ruled him a natural-born citizen and therefore eligible under the Constitution for the presidency even though he was born in pre-state Arizona when it was still a territory.

Asked if Cruz should get ahead of the issue, McCain said: “I would think so.”

“I got ahead of it on being born in the Canal Zone when I was running in 2008,” he said. “I said, ‘Look, there is a precedent set: Barry Goldwater ran for president; was born in Arizona when it was a territory.’ The Panama Canal was a territory of the United States of America.”

McCain also said he sees the Republican presidential nominating contest as far from settled.

“We live in most interesting times, and I do believe that there are going to be a lot more surprises, because every pollster I’ve talked to said there are still a lot of people who have not made up their minds,” he said.

On Thursday, Cruz also dismissed Donald Trump’s suggestion that he ask a judge for a declaratory judgment to stave off any sort of legal challenge to his candidacy.

“No,” Cruz said, “it’s not anything that’s going to happen and I’m not going to be taking legal advice anytime soon from Donald Trump.”

CNN’s Teddy Davis contributed to this report.