We describe the experimentally observed strong enhancement of the critical magnetic field in a nanosized Pb bridge on the basis of a numerical solution of the Ginzburg-Landau equations. The superconducting phase is shown to be strongly inhomogeneous in the bridge. Suppression of superconductivity by applied magnetic field or by temperature first occurs near the bases and then in the neck region, what leads to a continuous superconducting-to-normal resistive transition. The vortex states can be realized in the bridge at low temperatures T/T c =<0.6. We also analyze vortex states in the bridge characterized by a varying vorticity along the direction of the axis.