The multilevel generalized assignment problem (MGAP) is a variation of the generalized assignment problem, in which agents can execute tasks at different efficiency levels with different costs. We present a branchand-price algorithm that is the first exact algorithm for the MGAP. It is based on a decomposition into a master problem with set partitioning constraints and a pricing subproblem that is a multiple choice knapsack problem. We report on our computational experience with randomly generated instances with different numbers of agents, tasks and levels and with different correlations between cost and resource consumption for each agent-task-level assignment. Experimental results show that our algorithm is able to solve instances of the maximum size considered in the literature to proven optimality.