For a (molecular) graph, the first Zagreb index M1 is equal to the sum of squares of the vertex degrees, and the second Zagreb index M2 is equal to the sum of products of the degrees of a pair of adjacent vertices. In this work, we study the Zagreb indices of bipartite graphs of order n with diameter d and sharp upper bounds are obtained for M1(G) and M2(G) with G∈ℬ(n,d), where ℬ(n,d) is the set of all the n-vertex bipartite graphs with diameter d. Furthermore, we study the relationship between the maximal Zagreb indices of graphs in ℬ(n,d)...