Multivariate time series forecasting is a challenging task because the dynamic spatio-temporal dependencies between variables are a combination of multiple unknown association patterns. Existing graph neural networks typically model multivariate relationships with a predefined spatial graph or a learned fixed adjacency graph, which fails to handle the aforementioned challenges. In this study, we decompose association patterns into stable long-term and dynamic short-term patterns and propose a novel framework, named the static and dynamic graph learning network (SDGL), for modeling unknown patterns. Our approach infers two types of graph structures, from the data simultaneously: static and dynamic graphs. A static graph is developed to capture the fixed long-term pattern via node embedding, and we leverage graph regularity to control its learning direction. Dynamic graphs, which are time-varying matrices based on changing node-level features, are used to model dynamic dependencies over the short term. To effectively capture local dynamic patterns, we integrate the learned long-term pattern as an inductive bias. Experiments on six benchmark datasets show the state-of-the-art performance of our method. Analysis of the learned graphs reveals that the model succeeds in modeling dynamic spatio-temporal dependencies.