This paper studies the consensus problem for a class of multi-agent systems, where each agent is a nonlinear system affine in control. Distributed control laws are proposed for multi-agent systems with and without communication delays, respectively. It is shown that under undirected and connected communication network our control laws ensure the state consensus of multi-agent systems in both cases. The effectiveness of the proposed control laws is demonstrated by numerical simulation.