The move could appeal to women voters who might have been disillusioned by Barack Obama's decision to pick Joe Biden as his Democratic running-mate instead of Hillary Clinton, who won 18 million votes in her Democratic primary battle with Obama.
At 44, Palin is three years younger than Obama and, like McCain, she calls herself a "maverick".
Making the announcement, McCain's campiagn issued a statement saying: "Governor Palin is a tough executive who has demonstrated during her time in office that she is ready to be president."
Barack Obama's campaign immediately issued a statement condemning Palin as too inexperienced for the vice-presidency.
"Today, John McCain put the former mayor of a town of 9,000 with zero foreign policy experience a heartbeat away from the presidency," said Bill Burton, Obama's campaign spokesman.
Lucia Newman, Al Jazeera's correspondent in Dayton, Ohio, said Palin was an interesting choice for McCain.
"One of the perceived weaknesses of John McCain is that he is too old and he is also seen as being too close to the Republican establishment.
"Palin balances out the ticket - she is young and a maverick and brings across some voters who would have supported Hillary Cinton [as the Democratic presidential candidate] adn who are not yet convinced by [Barack] Obama."
Mitt Romney, McCain's former rival for the Republican nomination, and independent senator Joe Lieberman, had been top contenders for the position.
Tom Ridge, the former governor of Pennsylvania, had also been linked to role.
Early on Friday, Tim Pawlenty, the conservative Minnesota governor, said it was "a fair assumption" he would not be joining McCain on the Republican ticket.
Sean Aday, a political scientist at George Washington University, told Al Jazeera McCain had made a risky choice.
"She's actually pro-life, which helps McCain with his base. She has not been on the national stage. She comes from a very small state. She has never been in this situation."
McCain is preparing to accept his party's nomination for president at the Republican convention in St. Paul, Minnesota, next week.
On Thursday, Barack Obama, the Illinois senator, accepted the Democratic presidential, becoming the first African-American to win the nomination of a major US party.
By announcing his vice-presidential pick on Friday, observers say McCain was hoping to to divert attention from Obama, who attacked McCain in Thursday's acceptance speech, accusing him of following the policies of George Bush, the incumbent president.