Republican Senator John McCain may be on the same side of the aisle as President-elect Donald Trump, but when it comes to Trump's position on torture -- he has a few words of warning.
According to the Associated Press, McCain told a crowd during a panel discussion at the annual Halifax International Security Forum on Saturday, "We will not waterboard," regardless of what "the president of the United States wants to do or anybody else wants to do."
He added, "We will not torture people ... It doesn't work."
Related: See John McCain through the years:
John McCain through the years
John McCain through the years
20th August 1992: The Republican Senator from Arizona, John McCain, speaking at the Republican National Convention. A fomer prisoner of war for several years in Vietnam, he contested his party's nomination for the 2000 election. (Photo by Consolidated News Pictures/Getty Images)
HANOI, VIET NAM: U.S. Sen. John McCain, a former POW, looks 31 May 1993 at a display of personal belongings of American POWs at the joint POW/MIA archives center in the Hanoi Army Museum. McCain is with U.S. Sen. John Kerry and a delegation on a two-day visit aimed at obtaining more access to archives dealing with the fate of missing U.S. servicemen. (Photo credit should read HOANG DINH NAM/AFP/Getty Images)
UNITED STATES - FEBRUARY 27: TV RATINGS--Senate Commerce Committee Chairman John McCain, R-Ariz., during hearing on the TV ratings system. (Photo by Douglas Graham/Congressional Quarterly/Getty Images)
UNITED STATES - MAY 18: MCCAIN'S DAY--Sen John McCain, R-Ariz., relaxes in his office at about 2:15 p.m. (Photo by Scott J. Ferrell/Congressional Quarterly/Getty Images)
UNITED STATES - JUNE 02: McCAIN BILL--John McCain,R-Ariz.,during a press conference on the McCain Bill and tobacco legislation. (Photo by Douglas Graham/Congressional Quarterly/Getty Images)
WASHINGTON, : US Senator John McCain, R-AZ, chairman of the Senate Committee on Commerce, Science and Transportation begins the start of a hearing on the investigation of the scandal surrounding the 2002 Salt Lake City Winter Olympics on Capitol Hill in Washington, DC 14 April, 1999. AFP PHOTO/Mario TAMA (Photo credit should read MARIO TAMA/AFP/Getty Images)
HANOVER, : US Senator John McCain speaks to reporters 27 October,1999 in Hanover, New Hampshire. McCain criticized sugar, oil, and corn (shown behind) subsidies and linked them to 'soft money' campaign contributions. (ELECTRONIC IMAGE) AFP PHOTO Luke FRAZZA (Photo credit should read LUKE FRAZZA/AFP/Getty Images)
MANCHESTER, : Republican president hopeful John McCain greets supporters as he arrives at a debate forum sponsored by a local television station 02 December, 1999, in Manchester, New Hampshire. McCain will debate the other Republican candidates seeking the party's presidential nomination. (DIGITAL IMAGE) AFP PHOTO/John MOTTERN (Photo credit should read JOHN MOTTERN/AFP/Getty Images)
UNITED STATES - CIRCA 2000: John McCain addresses a shadow convention at the Annenberg Center of the University of Pennsylvania. McCain was booed when he asked suppoters to back his former primary opponent, George W. Bush. The shadow convention was put on near the site of the Republican National Convention in Philadelphia to highlight issues that the organizers say the major parties are ignoring. (Photo by Harry Hamburg/NY Daily News Archive via Getty Images)
CAMDEN, UNITED STATES: GOP presidential hopeful US Senator John McCain (R-AZ) waves during an 'Old Fashion BBQ and Stump Meeting' on the front yard of a supporter's house 08 January 2000 in Camden, South Carolina. (ELECTRONIC IMAGE) AFP PHOTO/Paul J. RICHARDS (Photo credit should read PAUL J. RICHARDS/AFP/Getty Images)
PETERBOROUGH, NH - JANUARY 30: Republican presidential hopeful Sen. John McCain (L) and his wife Cindy are showered with confetti following McCain's final town meeting 30 January, 2000 in Peterborough, New Hampshire. (ELECTRONIC IMAGE) (Photo credit should read C.J. GUNTHER/AFP/Getty Images)
GREENWOOD, : Republican presidential hopeful John McCain makes a point 14 February 2000 during a town hall meeting at the American Legion Post 20 in Greenwood, South Carolina. McCain is campaigning heavily in the southern state against Texas Governor Geroge W. Bush ahead of the 19 February 2000 primary. (ELECTRONIC IMAGE) AFP PHOTO/Tim SLOAN (Photo credit should read TIM SLOAN/AFP/Getty Images)
THE TONIGHT SHOW WITH JAY LENO -- Episode 1789 -- Pictured: (l-r) Senator John McCain during an interview with host Jay Leno on March 1, 2000 -- (Photo by: Paul Drinkwater/NBC/NBCU Photo Bank via Getty Images)
UNITED STATES - APRIL 30: Sen. John McCain, R-AZ, at a Senate Commerce, Science and Transportation Committee hearing on climate change. (Photo By Tom Williams/Roll Call/Getty Images)
** FILE ** In this Feb. 11, 2002 file photo, a bandaged Sen. John McCain, R-Ariz., takes part in a Washington news conference. Three-time melanoma survivor McCain appears cancer-free, has a strong heart and is in otherwise general good health, according to eight years of medical records reviewed by The Associated Press. (AP Photo/Stephen J. Boitano, File)
Sen. John McCain, R-Ariz., speaks to supporters during a speech at a fund-raider Thursday, Feb. 20, 2003, in Phoenix. McCain committed to his re-election campaign Thursday by telling supporters that he wants to continue helping the nation when it faces a struggling economy and unpredictable foreign enemies. (AP Photo/Tom Hood)
En route to Las Vegas, Nev., President Bush, joined by Sen. John McCain R-Ariz, right, talks to reporters on Air Force One about his final campaign push on the morning after his final debate, Thursday, Oct. 14, 2004. (AP Photo/J. Scott Applewhite)
UNITED STATES - FEBRUARY 12: TEMPORARY GUEST WORKERS--Witness Sen. John McCain, R-Ariz., during the Senate Judiciary Immigration, Border Security and Citizenship Subcommittee hearing titled 'Evaluating a Temporary Guest Worker Proposal.' (Photo by Scott J. Ferrell/Congressional Quarterly/Getty Images)
UNITED STATES - JUNE 28: SENATE POLICY LUNCHES--Sen. John McCain, R-Ariz., talks to reporters after the Senate GOP policy luncheon. (Photo by Scott J. Ferrell/Congressional Quarterly/Getty Images)
WASHINGTON - SEPTEMBER 20: U.S. Senator John McCain (R-AZ) addresses The Northern Virginia Technology Council's Titans breakfast at the Capitol Hilton September 20, 2006 in Washington, DC. McCain spoke on a variety of subjects, including telecommunications legislation, net neutrality, research and development tax credits, immigration, and Internet taxes. He also addressed the rift that he and several other Republican senators are having with the White House over the Geneva Conventions. (Photo by Chip Somodevilla/Getty Images)
Discover More Like This
BACK TO SLIDE
On the campaign trail Trump told supporters he wants to change laws barring waterboarding, a technique used against suspected terrorists during the Bush administration.
McCain was tortured while being held captive during the Vietnam War. He reminded the audience that torture is illegal not just under U.S. law, but under the Geneva Conventions as well.
Trump has been a focus of many of the discussions at the Security Forum which is attended by top defense and security officials from across the world.
Related: Learn more about John McCain's experience in Vietnam:
John McCain military capture and rescue
John McCain military capture and rescue
A photo taken by a French cameraman in 1967 shows US Navy Airforce Major John McCain lying on a bed in a Hanoi hospital as he was being given medical care for his injuries. John McCain was captured in 1967 at a lake in Hanoi after his Navy warplane was downed by the Northern Vietnamese army during the Vietnam War.
P368426 01: (File Photo) Senator John Mccain Is Pulled Out Of A Hanoi Lake By North Vietnamese Army Soldiers And Civilians October 26, 1967 In Hanoi, North Vietnam. Mccain's A-4E Skyhawk Was Shot Down By A Surface-To-Air Missile. Mccain Broke Both Arms And His Right Knee Upon Ejection And Lost Consciousness Until He Hit The Water. (Photo By Getty Images)
P368426 04: (File Photo) Senator John Mccain In A Hanoi Hospital During The Vietnam War November, 1967. (Photo By Getty Images)
P368426 06: (File Photo) A Statue Commemorating October 26, 1967, The Day Lt. Cmdr. John Mccain Was Captured By The North Vietnamese Army, Stands In Hanoi, North Vietnam. (Photo By Getty Images)
P368426 05: (File Photo) A Mug Shot Of Senator John Mccain As A P.O.W. Taken By The North Vietnamese Sometime Between 1967-73 (Photo By Getty Images)
HANOI, VIET NAM: This file picture taken in 1967 shows US Navy Airforce Major John McCain lying on a bed in a Hanoi hospital as he was being given medical care for his injuries. McCain was captured in 1967 at a lake in Hanoi after his Navy warplane was downed by the Northern Vietnamese army during the Vietnam War. One of his rescuers said 24 February 2000, McCain was well treated after being pulled from the lake by villagers. McCain said that upon capture he was beaten by an angry mob and bayoneted in the groin. (B/W ONLY) AFP PHOTO (Photo credit should read AFP/Getty Images)
U.S. Naval Lt. Commander John S. McCain III, son of the Navy's Commander-in-Chief in Europe and grandson of the Navy's greatest World War II carrier commanders, is show in July, 1967, in Vietnam. (AP Photo)
John McCain walks outside the Hoa Lo prison, nicknamed "The Hanoi Hilton" in Hanoi, Vietman on April 26, 2000 where McCain was kept as a prisoner of war from October 1967 until March 1973. McCain was visiting as Vietnam marked the 25th anniversary of the end of the war. (AP Photo/David Guttenfelder)
John McCain walks inside the Hoa Lo prison, nicknamed "The Hanoi Hilton" in Hanoi, Vietman on April 27, 2000 where McCain was kept as a prisoner of war from October 1967 until March 1973. McCain was visiting as Vietnam marked the 25th anniversary of the end of the war. (AP Photo/David Guttenfelder)
Sen. John McCain, R-Ariz., tells his son Jack about his time as a Vietnam war P.O.W. as they look into a prison cell at the Hoa Lo prison, nicknamed "The Hanoi Hilton" by American prisoners, during a visit in this April 26, 2000 file photo. McCain was a P.O.W. from October 1967 to March 1973 and spent 3 years locked in the Hoa Lo. McCain, his wife Cindy, and son were visiting Vietnam as the country prepares to mark the 25th anniversary of the end of the war on April 30. (AP Photo/David Guttenfelder, File)
U.S. Sen. John McCain, R-Ariz, is seen during a tour of Hoa Lo Prison site, Hanoi, Vietnam, Wednesday, April 8, 2009. The photo behind McCain is that the Hanoi army and people pull out McCain out of Truc Back Lake on Oct. 26, 1967 after his plane was shot down. (AP Photo/Chitose Suzuki)
Mai Van On gestures to U.S. Senator John McCain, left, on Wednesday, Nov. 13, 1996 while describing how he pulled on McCain's parachute to save him from Hanoi's Truc Bach lake in 1967. McCain, then a U.S. bomber pilot in the Vietnam War, was shot down over Hanoi 29 years ago. (AP Photo/Hong Sam)
John McCain stands next to a monument marking the spot on the banks of Lake Truc Bach in Hanoi, Vietman on April 26, 2000 where McCain was pulled ashore after his plane was shot down in October 1967. McCain was visiting as Vietnam marked the 25th anniversary of the end of the war. (AP Photo/David Guttenfelder)
Lt. Commander John S. McCain III, 30, right, shown in 1967, member of a famous U.S. Navy family and an aircraft carrier pilot, was shot down and captured in Hanoi. His father, John S. McCain Jr., center, is the U.S. Navy's commander in chief in Europe. His granfather, left, Adm. John S. McCain, commanded all U.S. aircraft carriers in the Pacific during World War II. (AP Photo)