In this paper, the exact stiffness matrix of curved beams with nonuniform cross section is derived using direct method. The considered element has two nodes and 12 degrees of freedom, with three forces and three moments applied at each node. The noncoincidence effect of shear center and center of area is also considered in this element. The deformations of the beam are due to bending, torsion, tensile, and shear loads. The line passing through center of area is a general three-dimensional curve and the cross section properties may change arbitrarily along it. The method is extended to deal with distributed loads on the curved beams. The stiffness matrix of some selected types of beams is determined by this method. The results are compared (where possible) with previously published results, simple beam finite element analysis and analytic solution. It is shown that the determined stiffness matrix is exact and that any type of beam can be analyzed by this method.