The cardinality of a metric basis of a connected graph G is called its metric dimension, denoted by dim(G) and the maximum value of distance between vertices of G is called its diameter. In this paper, the graphs G with diameter 2 are characterized when dim(G) = 2.