In 1942 Napolitano matriculated at the University of Naples Federico II. He adhered to the local Gioventù Universitaria Fascista ("University Fascist Youth"), where he met his core group of friends, who shared his opposition to Italian fascism. As he would later state, the group "was in fact a true breeding ground of anti-fascist intellectual energies, disguised and to a certain extent tolerated".
A theatre enthusiast since high school, during his university years he contributed a theatrical review to the IX Maggio weekly magazine, and had small parts in plays organised by the Gioventù Universitaria Fascista itself.
During the Nazi occupation of Italy in the final period of World War II, he and his circle of friends took part in several actions of the Italian resistance movement against German Nazi and Italian fascist forces. This included occupying the offices of the IX Maggio magazine and using it to publish writings of Karl Marx masked as articles signed by the various components of the group.
He was first elected to the Chamber of Deputies in 1953 for the electoral division of Naples, and was returned at every election until 1996. He was elected to the National Committee of the party during its eighth national congress in 1956, largely thanks to the support offered by Palmiro Togliatti, who wanted to involve younger politicians in the central direction of the party. He became responsible for the commission for Southern Italy within the National Committee.
Later on in the same year, the 1956 Hungarian Revolution and its military suppression by the Soviet Union occurred. The leadership of the Italian Communist Party labelled the insurgents as counter-revolutionaries, and the party newspaper L'Unità referred to them as "thugs" and "despicable agents provocateurs". Napolitano complied with the party-sponsored position on this matter, a choice he would repeatedly declare to have become uncomfortable with, developing what his autobiography describes as a "grievous self-critical torment". He would reason that his compliance was motivated by concerns about the role of the Italian Communist Party as "inseparable from the fates of the socialist forces guided by the USSR" as opposed to "imperialist" forces.
The decision to support the USSR against the Hungarian revolutionaries generated a split in the Italian Communist Party, and even the CGIL (Italy's largest trade union, then overtly communist in nature) refused to conform to the party-sponsored position and applauded the revolution, on the basis that the eighth national congress of the Italian Communist Party had indeed stated that the "Italian way to socialism" was to be democratic and specific to the nation. These views were supported in the party by Giorgio Amendola, whom Napolitano would always look up to as a teacher. Frequently seen together, Giorgio Amendola and Giorgio Napolitano would jokingly be referred to by friends as (respectively) Giorgio 'o chiatto and Giorgio 'o sicco ("Giorgio the podgy" and "Giorgio the slim" in the Neapolitan dialect).
His political ideas were somewhat moderate in the context of the PCI: in fact he became the leader of the so-called "meliorist wing" (corrente migliorista) of the party, whose members notably included Gerardo Chiaromonte and Emanuele Macaluso. The term migliorista (from migliore, Italian for "better") was coined with a slightly mocking intent.
In the mid-seventies, Napolitano was invited by the Massachusetts Institute of Technology to give a lecture, but the then United States ambassador to Italy, John A. Volpe, refused to grant him a visa on account of his membership in the Communist Party. Between 1977 and 1981 Napolitano had some secret meetings with the United States ambassador Richard Gardner, at a time when the PCI was seeking contact with the US administration, in the context of its definitive break with its past relationship with the Communist Party of the Soviet Union and the beginning of eurocommunism, the attempt to develop a theory and practice more adequate to the democratic countries of Western Europe. In 2006, when Napolitano was elected President of the Italian Republic, Gardner stated to AP Television News that he considered Napolitano "a real statesman", "a true believer in democracy" and "a friend of the United States [who] will carry out his office with impartiality and fairness". Thanks to this role and in part by the good offices of Giulio Andreotti, in the 1980s Napolitano was able to travel to the United States and give lectures at Aspen, Colorado and at Harvard University. He has since visited and lectured in the United States several times.
The centre-left majority coalition, on May 7 2006, officially endorsed Giorgio Napolitano as its candidate in the special election that began on May 8. The Vatican endorsed him as President through its official newspaper, L'Osservatore Romano, just after the Union named him as its candidate, as did Marco Follini, former secretary of the UDC, the right-leaning Christian party, member of the House of Freedoms.
Napolitano was elected on May 10, in the fourth round of voting—the first round which required only an absolute majority, unlike the former three which required two-thirds of the votes—with 543 votes (out of a possible 1009). He was the first former Communist to become President of Italy, as well as the third Neapolitan after Enrico De Nicola and Giovanni Leone. After his election, expressions of esteem toward his person and his authority as future President of the Italian Republic were made by both members of the Union and of the House of Freedoms (who had issued a blank vote), such as Pier Ferdinando Casini. Nevertheless, some Italian right-wing newspapers, such as il Giornale, expressed concerns about his communist past. He started his term on May 15.
On September 26, 2006, Napolitano made an official visit to Budapest, Hungary, where he paid tribute to the fallen in the 1956 revolution, which he initially opposed as member of the Italian Communist Party, by laying a wreath at Imre Nagy's grave.
On February 10, 2007 a diplomatic crisis arose between Italy and Croatia, after President Napolitano publicly condemned the foibe massacres on the Foibe Memory Day. The European Commission did not comment on this event, but did comment (and partly condemn) the response by Croatian president Stjepan Mesić, who described Napolitano's statement as racist, because Napolitano did not refer either to Slovenians or Croatians as a nation, when he spoke about a "Slavic annexationist aspiration"" for the Julian March (at the time, Slovenians and Croatians fought together in the Yugoslav Resistance Movement). Another matter of debate in Croatia was that the Italian President made awards to relatives of 25 foibe victims, who included the last fascist Italian prefect in Zadar, Vincenzo Serrentino, convicted to death in 1947 in Šibenik. That was seen by Mesić as "historic revisionism" and open support for revanchism. President Napolitano's remarks on the foibe massacres were praised by both centre-left and centre-right in Italy, and both coalitions condemned Mesić's statements, while the whole of Croatia stood by Mesić, who later acknowledged that Napolitano didn't want to put in discussion the Peace Treaty of 1947.
On February 21, 2007, Prime Minister Romano Prodi submitted his resignation after losing a foreign policy vote in the Parliament; Napolitano held talks with the political groups in parliament, and on February 24 rejected the resignation, prompting Prodi to ask for a new vote of confidence. Prodi won the vote in the upper house on February 28 and in the lower house on 2 March, allowing his cabinet to remain in office.
On 24 January 2008 Romano Prodi lost a vote of confidence in the Senate by a vote of 161 to 156 votes, after the Popular-UDEUR party ended its support for the government. President Napolitano requested the president of the Senate, Franco Marini, to assess the possibility to form a caretaker government. On 4 February 2008 Marini acknowledged impossibility to form an interim government due to the unavailability of the centre-right parties, and on 6 February 2008 Napolitano dissolved the Parliament. Elections was held on 13 April and 14 April 2008, together with the administrative elections, and won by Berlusconi, depriving Prodi of his office.