As the main building block of the smart grid, microgrid (MG) integrates a number of local distributed generation units, energy storage systems and local load together to form a small-scale low- and medium- voltage level power system. In general, an MG can operate in two modes, i.e., the grid-connected and islanded mode. Recently, in order to standardize its operation and functionality, hierarchical control for islanded MG systems has been proposed. It divides the control structure into three layers, namely, primary, secondary, and tertiary control. The primary control is based on each local distributed generation (DG) controller and is realized in a decentralized way. In the secondary layer, the frequency and voltage restoration control as well as the power quality enhancement is usually carried out. In the tertiary control, economic dispatch and power flow optimization issues are considered. However, conventionally both the secondary and tertiary control are realized in a centralized way. There are certain drawbacks of such centralized control, such as high computation and communication cost, poor fault tolerance ability, lack of plug-and-play properties and so on. In order to overcome the above drawbacks, distributed control is proposed in the secondary and tertiary control in this thesis. In the secondary control, restorations for both voltage and frequency in the droop-controlled inverter-based islanded MG are addressed. A distributed finite-time control approach is used in the voltage restoration which enables the voltages at all the DGs to converge to the reference value in finite time, and thus, the voltage and frequency control design can be separated. Then, a consensus-based distributed frequency control is proposed for frequency restoration, subject to certain control input constraints. The proposed control strategy can restore both voltage and frequency to their respective reference values while having accurate real power sharing, under a sufficient local stability condition established. Then the distributed control strategy is also employed in the secondary voltage unbalance compensation to replace the conventional centralized controller. The concept of contribution level (CL) for compensation is first proposed for each local DG to indicate its compensation ability. A two-layer secondary compensation architecture consisting of a communication layer and a compensation layer is designed for each local DG. A totally distributed strategy involving information sharing and exchange is proposed, which is based on finite-time average consensus and newly developed graph discovery algorithm. In the tertiary layer, a distributed economic dispatch (ED) strategy based on projected gradient and finite-time average consensus algorithms is proposed. By decomposing the centralized optimization into optimizations at local agents, a scheme is proposed for each agent to iteratively estimate a solution of the optimization problem in a distributed manner with limited communication among neighbors. It is shown that the estimated solutions of all the agents reach consensus of the optimal solution asymptomatically. Besides, two distributed multi-cluster optimization methods are proposed for a large-scale multi-area power system. We first propose to divide all the generator agents into clusters (groups) and each cluster has a leader to communicate with the leaders of its neighboring clusters. Then two different schemes are proposed for each agent to iteratively estimate a solution of the optimization problem in a distributed manner. It is theoretically proved that the estimated solutions of all the agents reach consensus of the optimal solution asymptomatically. A distributed optimal energy scheduling strategy is also proposed in the tertiary layer, which is based on a newly proposed pricing strategy named \emph{PD pricing}. Conventional real-time pricing strategies only depend on the current total energy consumption. In contrast to this, our proposed pricing strategy also takes the incremental energy consumption into consideration, which aims to further fill the valley load and shave the peak load. An optimal energy scheduling problem is then formulated by minimizing the total social cost of the overall power system. Two different distributed optimization algorithms with different communication strategies are proposed to solve the problem. Doctor of Philosophy (IGS)