We consider a mesoscopic region coupled to two leads under the influence of external timedependent voltages. The time dependence is coupled to source and drain contacts, the gates controlling the tunnel-barrier heights, or to the gates that define the mesoscopic region. We derive, with the Keldysh nonequilibrium-Green-function technique, a formal expression for the fully nonlinear, time-dependent current through the system. The analysis admits arbitary interactions in the mesoscopic region, but the leads are treated as noninteracting. For proportionate coupling to the leads, the time-averaged current is simply the integral between the chemical potentials of the time-averaged density of states, weighted by the coupling to the leads, in close analogy to the time-independent result of Meir and Wingreen [Phys. Rev. Lett. 68, 2512 (1992)]. Analytical and numerical results for the exactly solvable noninteracting resonant-tunneling system are presented. Due to the coherence between the leads and the resonant site, the current does not follow the driving signal adiabatically: a "ringing" current is found as a response to a voltage pulse, and a complex time dependence results in the case of harmonic driving voltages. We also establish a connection to recent linear-response calculations, and to earlier studies of electron-phonon scattering effects in resonant tunneling.