We study the generation of the directed flow in the hydrodynamic expansion of hot matter formed in ultrarelativistic heavy-ion collisions at √ s = 200GeV. The experimentally observed negative directed flow in a wide range of central pseudorapidities is reproduced, assuming that the fireball is tilted away from the collision axis. The tilt of the source is consistent with a preferential emission in the forward/backward hemisphere from forward/backward participating nucleons. The model reproduces the experimentally observed scaling of the directed flow when going from Au-Au to Cu-Cu systems.