To cope with wind power uncertainty, balancing authorities are required to procure adequate ancillary services (ASs) with the aim of maintaining the security of the power system operation. The transmission system operator (TSO) is responsible for maintaining the balance between supply and demand in delivery hours. Besides the generating units, demand response (DR) has the potential capabilities to be considered as a source of AS. The demand-side AS can be used both locally (by the local entities in distribution networks) and system-wide (by the TSO). However, the optimal coordination between the local and global beneficiaries is a challenging task. This study proposes a distributed DR market model, in which the DR is traded as a public good among the providers and beneficiaries through the local DR markets. The local DR markets can be run in each load bus to trade the DR provided by retail customers connected to that bus with the buyers. To include the interactions between the energy/reserve market and the local DR markets, a bi-level programming model is proposed. The bi-level problem is translated into a single-level mixed-integer linear programming problem using the duality theorem. The proposed model is verified by simple and realistic case studies. Remark 1: Some of the abovementioned constants and variables incorporate superscript U, D, NS when referring to the upward, downward, or non-spinning reserve/DR, respectively. Remark 2: A variable, function, or parameter written in bold without one or more indices is a vector form representing the corresponding quantities. For example, the symbol P t S represents the vector of scheduled power of generating units during period t.