Spatial regression models are widely used in numerous areas, including detecting and predicting traffic volume, air pollution, and housing prices. Unlike conventional regression models, which commonly assume independent and identical distributions among observations, existing spatial regression requires the prior knowledge of spatial dependency among the observations in different spatial locations. Such a spatial dependency is typically predefined by domain experts or heuristics. However, without sufficient consideration on the context of the specific prediction task, it is prohibitively difficult for one to pre-define the numerical values of the spatial dependency without bias. More importantly, in many situations, the existing techniques are insufficient to sense the complete connectivity and topological patterns among spatial locations (e.g., in underground water networks and human brain networks). Until now, these issues have been extremely difficult to address and little attention has been paid to the automatic optimization of spatial dependency in relation to a prediction task, due to three challenges: (1) necessity and complexity of modeling the spatial topological constraints; (2) incomplete prior spatial knowledge; and (3) difficulty in optimizing under spatial topological constraints that are usually discrete or nonconvex. To address these challenges, this article proposes a novel convex framework that automatically jointly learns the prediction mapping and spatial dependency based on spatial topological constraints. There are two different scenarios to be addressed. First, when the prior knowledge on existence of conditional independence among spatial locations is known (e.g., via spatial contiguity), we propose the first model named Spatial-Autoregressive Dependency Learning I (SADL-I) to further quantify such spatial dependency. However, when the knowledge on the conditional independence is unknown or incomplete, our second model named Spatial-Autoregressive Dependency Learning II (SADL-II) is proposed to automatically learn the conditional independence pattern as well as quantify the numerical values of the spatial dependency based on spatial topological constraints. Topological constraints are usually discrete and nonconvex, which makes them extremely difficult to be optimized together with continuous optimization problems of spatial regression. To address this, we propose a convex and continuous equivalence of the original discrete topological constraints with a theoretical guarantee. The proposed models are then transferred to convex problems that can be iteratively optimized by our new efficient algorithms until convergence to a global optimal solution. Extensive experimentation using several real-world datasets demonstrates the outstanding performance of the proposed models. The code of our SADL framework is available at: http://mason.gmu.edu/∼lzhao9/materials/codes/SADL.