Advances in Smart Grids are made the demand response programs much more applicable in distribution systems operation and planning. In this thesis, an optimal method for real-time demand response in a smart distribution grid is presented. The proposed real-time demand response has two stages, namely market based program and network based program. The earlier stage includes the real-time pricing demand response program in which the real-time nodal prices and optimal hourly loads are determined through an interactive strategy between customers and Distribution Company. In order to determine the preferred amount of the load used by the customers, elasticity concept is applied in response to energy price per hour. The second stage will be run by the Distribution Network Operator (DNO), if the operational constraints were not fulfilled, considering the distribution status resulted from the market based program. An optimal method for implementation of emergency demand response program is presented. In this stage, aimed at minimizing the price of electricity while network constraints are satisfied, the DNO optimizes the costs based on the costumers bids (willing to reduce their loads at a certain amount of incentive) and curtailment or interrupting the customers’ loads (based on the long term contracts between the DNO and special customers). In this stage, only emergency demand response and direct load control programs are considered among the demand response programs. Implementing the suggested method on the 33-bus distribution network (in Matlab) and considering different operational scenarios, the efficiency of the suggested model is studied. Keywords: Real-time Demand Response, Smart Grid, Nodal Real-Time Pricing