Donkey carts clattered across cobblestone streets; butchers wielding cleavers hacked away at sides of lamb, beef and camel; women haggled in Arabic, French or Tamazight, a local Berber language. We were in Fez's meat, produce and spice market, maneuvering through the chaos with the guidance of Lahcen Beqqi, a master chef and expert on Moroccan cooking.

My wife, Ruth, and I had signed up for a one-day cooking class taught by Beqqi to learn more about Morocco and its cuisine. Beqqi, a 32-year-old baby-faced Berber from a small mountain village, made a fitting teacher. He had moved to Fez, the country's food capital, in 2002 and had cooked at some of the city's finest restaurants until he opened a school, Fes Cooking, in 2006. His classes offer not only cooking instruction (and eating, of course), but also an introduction to Moroccan shopping and mealtime traditions.

We, along with the chef and two other students, had begun our day at the market of this 1,200-year-old imperial city. Because our menu would be dictated by what was available ("eat seasonal, buy local" has long been a way of life here), we wandered the narrow walkways surveying the possibilities. The sweet scent of cinnamon and rose water filled the air; stalls overflowed with tomatoes, onions, celery, garlic. "It was a good year for farmers with lots of rain, so there are no shortages," Beqqi said.

He pointed out foods that in American kitchens would be considered specialty items, but are essential to traditional Moroccan cooking: dates, figs, chickpeas, mint. He described products that drew our blank and uncomprehending stares: wild artichokes, argan oil, cardons, camel fat.

We made our way back through the market, buying what we needed, and headed to the classroom at Riad Tafilalet, a hotel and restaurant.

Although thoroughly modern, the kitchen contained no electric mixers, blenders, or food processors. According to Beqqi, Moroccan cooks enjoy "being close to their food," so all chopping is by hand, all mashing by mortar and pestle.

The students donned starched white chef tunics, looking like contestants on "The Next Food Network Star," and dove into assigned tasks. Baqqi watched carefully and explained proper techniques: "Don't add spices until the liquid is hot"; "Grate the tomatoes, don't chop them."

Three hours later, our six-course lunch feast was prepared. In the riad's sunlit courtyard, we sat around low tables dining on harira, a tomato, lentil and chickpea soup traditionally used to break the daily fast of Ramadan; small triangles of phyllo pastry called briouates, filled with goat cheese and olives; zaalouk salad prepared with pureed eggplant, tomato and zucchini; artichoke hearts with preserved lemons and orange water; lamb, prune and date tagine, and, for dessert, date and almond rolls along with the ever-present sweet mint tea.

As we relished the meal during two glorious hours, Beqqi related stories of the multiethnic influences that have produced this distinctive cuisine: the Berbers of southern Morocco who brought tagines and couscous; seventh-century Arab invaders who introduced grilled meats and a love of dried fruits and nuts; Moors who contributed their taste for olives, oranges and lemons, and Sephardic Jews of North Africa who popularized the pickling and preserving of fruits and meats, plus the gastronomic contributions of Ottoman and French colonists.

I lay back on the sofa and sipped my last glass of tea, feeling like a pampered pasha. At 4 p.m., after a busy but gratifying day, Beqqi called a taxi to take us back to our hotel, a trip whose cost was, thankfully, based on distance, not weight.

G. Michael Schneider, a professor of mathematics and computer science at Macalester College, divides his time between St. Paul and Manhattan.