The goal of link prediction is to estimate the possibility of future links among nodes using known network information and the attributes of the nodes. According to the time-varying characteristics and the node's mobility of opportunistic networks, this paper proposes a novel link prediction method based on the Bayesian recurrent neural network (BRNN-LP) framework. The time series data of a dynamic opportunistic networks is sliced into snapshots in which there exist the correlation information and spatial location information. A vector of a snapshot is constructed based on such information, which represents the link information. Then, the vectors of multiple network snapshots constitute a spatiotemporal vector sequence. Benefiting from the BRNN's ability of extracting the features of time series data, the correlation between spatiotemporal vector sequence and node connection states is learned, and the law of the link evolution is captured to predict future links. The results on the MIT Reality dataset show that compared with methods such as the similarity-based indices, the support vector classifier, linear discriminant analysis and recurrent neural network, the proposed prediction method is more accurate and stable.INDEX TERMS Link prediction, opportunistic networks, Bayesian recurrent neural network.