McCain's victory in the Republican nomination came a month after his success in multiple states on so-called "Super Tuesday" gave him a large lead in the delegate race and led to his main rival, former Massachusetts governor Mitt Romney, dropping out.
At a speech in Dallas, Texas, McCain looked ahead to the presidential election and said "the big battle is to come".
"I do not underestimate the significance nor the size of the challenge," he said.
"I understand the responsibilities I incur with this nomination and I will not ... slight a single one."
He is expected to be formally endorsed by George Bush, the US president, later in the week.
His former rival, Mike Huckabee, also speaking in Texas, announced he was dropping out of the race and said he had spoken with McCain to congratulate him.
He also urged the Republican party to unite behind one candidate.
"It's now important that we turn our attention not to what could have been or what we wanted to have been but what now must be, and that is a united party," the former Arkansas governor told supporters.
McCain has made support for continuing the US war effort in Iraq a centrepiece of his campaign.
Rob Reynolds, Al Jazeera's correspondent in Dallas, Texas, said: "McCain can now move forward with fundraising efforts and with building a nationwide organisation oriented toward the general election campaign, while Hillary Clinton and Barack Obama are still fighting among themselves for the Democratic nomination.
"But McCain still has not completely won the hearts and minds of his partys conservative wing, which dislikes his stands on tax cuts, immigration and other issues."