The health of the monarch has been fragile for some years. His successor will be his son, Crown Prince Sidi Mohamed, who announced the death on state television late Friday.
The monarch was hospitalized earlier in the day in Rabat, the capital, for an acute lung infection, according to a palace statement. The Crown Prince gave the cause of death as a heart attack.
"I announce to the Arab and Islamic nations and to the whole world the death of a great leader and a man of this world's great men," the crown prince said.
Television and radio stations stopped regular programming and broadcast readings from the Koran, something done only when a top official dies.
Hassan's death deprives the Middle East of an important peacemaker. His diplomacy helped bring about the 1979 peace treaty between Israel and Egypt and subsequent agreements between Israel and the Palestine Liberation Organization, and with Jordan.
Hassan was friendly with the United States and has given counsel to every American president since John F. Kennedy. President Clinton will attend the funeral service Sunday in Morocco.
An all-powerful monarch, Hassan is revered as a descendant of the Prophet Mohammed and has been an important unifying force in Morocco.
Moroccans like to say Hassan has "baraka," signifying that he had God on his side through a series of daring political maneuvers.
In May 1995 Hassan mediated peace talks between Israeli Foreign Minister Shimon Peres and PLO chief Yasser Arafat. Peres later told Israeli radio that Hassan's mediating role was "giving impetus to the process."
And a summit of the world's Muslim leaders hosted by the king in 1994 resulted in a public statement against Islamic extremism. The statement was one of the resolutions made at the December 1994 summit of the 52-nation Organization of the Islamic Conference, which brought together leaders of the Middle East, Europe and Asia.
In 1983, Hassan bluntly violated an Arab taboo, inviting hundreds of Jews of Moroccan origin, many from Israel, to a convention in Morocco.
The monarch took another of his greatest risks in the 1980s in inviting Peres to meet him in Morocco for secret talks seeking to end the Middle East deadlock.
Early in his reign, Hassan ignored advisers who warned of the risk involved in instituting the Arab and Islamic world's only genuine multiparty democracy.
He enjoyed a prestige and influence in the world far beyond the global importance of his Muslim nation of 25 million facing the Atlantic, the Mediterranean and the southern shoreline of the Straits of Gibraltar.
Hassan inherited the throne of Morocco when his father, King Mohamed V, died in 1961.
Almost immediately, he was plunged into a desert war with Morocco's newly-independent Arab neighbor, Algeria.
In his first spectacular initiative a king, he met Algeria's then president, Ahmed Ben Bella, in Bamako, the capital of neighboring Mali, and made sweeping concessions with which he won 12 years of peace in the Sahara.
But his own army grumbled at the abandonment of thousands of square miles of sand to Algeria. Some army leaders dreamed of a military dictatorship, and in July 1971, 2,000 men overran Hassan's birthday party in the ocean-front palace of Skhirat. Nearly 100 of the guests were killed.