Motivated by economic and empirical arguments, we consider a company whose cash reservoir is afiected by macroeconomic conditions. Speciflcally, we model the cash reservoir as a Brownian motion with drift and volatility modulated by an observable continuous-time Markov chain that represents the regime of the economy. The objective of the management is to select the dividend policy that maximizes the expected total discounted dividend payments to be received by the shareholders. We study three difierent cases: bounded dividend rates, unbounded dividend rates, and the case in which there are flxed costs and taxes associated to the dividend payments. These cases generate, respectively, problems of classical stochastic control with regime switching, singular stochastic control with regime switching, and stochastic impulse control with regime switching (a new problem in the stochastic control literature). We solve these problems, and obtain the flrst analytical solutions for the optimal dividend policy in the presence of business cycles. Our results show, among other things, that the optimal dividend policy depends strongly on macroeconomic conditions.