Senator John McCain races through the final days of the presidential race reciting a familiar admonition. It is the same mantra he has called upon to steel himself for moments of conflict as a collegiate boxer at the Naval Academy, a prisoner of war bracing for interrogation, a legislator twisting arms for votes, or as a Republican primary candidate rallying crowds against an all-but-certain defeat.

“Game face on!” he murmurs to himself, borrowing the advice of so many athletic coaches.

Some friends say the expression is a metaphor for an essential tension that runs through Mr. McCain’s life. He is often deliberative, self-critical and flexible, his advisers and fellow senators say, and has frequently corrected course during his 36 years in public life. “He is a much more supple mind than he is usually portrayed,” said Philip Bobbitt, an international relations scholar and Democrat the senator consulted this summer.

But when he confronts an adversary, a starkly different John McCain can emerge, fired up with certainty for an all-or-nothing battle. “I am going to win this thing and you are going to have to run me over to defeat me,” said former Senator Bob Kerrey, a Democrat close to Mr. McCain, explaining his friend’s attitude. “It is a face that makes his opponent think, ‘I don’t know if I want to get my nose bloodied by this guy.’ ”

The conflicting impulses toward deliberation and aggression have been the alternating currents of his singular career and, if Mr. McCain wins the White House, could shape his presidency. As a Navy pilot, Mr. McCain has written, he let his “cockiness” deafen him to the risk of a buzzer warning of enemy fire. But as a returning prisoner of war he drew nuanced conclusions about political leadership and public opinion that have left him at some times a dove (Lebanon, Somalia ) and others a hawk (the Balkans, Iraq).