This paper deals with the leader-following consensus of multi-agent systems with matched nonlinear dynamics. Compared with previous works, the major difficulty here is caused by the simultaneous existence of nonidentical agent dynamics and unknown system parameters, which are more practical in real-world applications. To tackle this difficulty, a distributed adaptive control law for each follower is proposed based on algebraic graph theory and algebraic Riccati equation. By a Lyapunov function method, we show that the designed control law guarantees that each follower asymptotically converges to the leader under connected communication graphs. A simulation example demonstrates the effectiveness of the proposed scheme.