Secretary of State John Kerry Friday pledged US support for Moroccan reforms and efforts to promote regional stability, while highlighting social challenges faced by Rabat.
"Morocco is playing an important leadership role, and the United States will stand by this relationship every step of the way," he said at the end of a North African tour.
"The 18 different agreements that Morocco signed with Mali show that Morocco is driving greater security and greater prosperity in the region," Kerry added, speaking in Rabat alongside his Moroccan counterpart, Salaheddine Mezouar.
Those accords, signed in February during a tour of West Africa by King Mohammed VI, included an agreement to train hundreds of imams in Morocco.
Rabat is considered an important US ally in combatting radical Islamist ideology, which has enjoyed a revival elsewhere in North Africa since the 2011 Arab Spring uprisings that swept away decades-old dictatorships.
Morocco's agreement to train imams from nearby countries afflicted by jihadist violence, such as Mali, Tunisia and Libya, forms part of its strategy of promoting a more tolerant version of Islam.
Kerry met Moroccan Prime Minister Abdelilah Benkirane after flying to Rabat from Algiers on Thursday evening. He was to meet King Mohammed VI in Casablanca later on Friday before returning to Washington.
He cited joint military exercises being conducted by Moroccan armed forces and US Africa Command (AFRICOM) in the southern city of Agadir as an aspect of the two countries' strategic cooperation between.
Despite their ties, Rabat cancelled the same military excercise, known as African Lion, during a diplomatic spat last year caused by Washington's surprise proposal to task the UN peacekeeping force in the disputed Western Sahara force with human rights monitoring.
Morocco controls most of the former Spanish colony, which it considers an integral part of its territory. It fiercely resisted the move, lobbying aggressively to have the proposal dropped, which eventually happened.
Following the rift, King Mohammed flew to Washington to meet Barack Obama in November, and the president praised him for promoting economic progress and human development.
He also welcomed the king's commitment to abolish the military trial of civilians, a practice the Moroccan government finally agreed to do in a bill approved last month.
Kerry said the United States was "deeply committed" to supporting the "major reforms" already undertaken by the king.
But he warned of the "enormous" social challenges facing Morocco and other countries across the region. He cited the 2011 uprisings in Tunisia and Egypt as examples of the dangers facing governments that fail to provide opportunities for their burgeoning youth population.
"Sixty percent of the country is under 30 years old," Kerry said.
"The challenge of any government under those circumstances is to be able to provide jobs and opportunities for its young people. And that challenge is enormous."