The increasing penetration of distributed energy resources (DERs) in the distribution networks has turned the conventionally passive load buses into active buses that can provide grid services for the transmission system. To take advantage of the DERs in the distribution networks, this letter formulates a transmission-and-distribution (T&D) systems co-optimization problem that achieves economic dispatch at the transmission level and optimal voltage regulation at the distribution level by leveraging large generators and DERs. A primal-dual gradient algorithm is proposed to solve this optimization problem jointly for T&D systems, and a distributed market-based equivalent of the gradient algorithm is used for practical implementation. The results are corroborated by numerical examples with the IEEE 39-Bus system connected with 7 different distribution networks.