Collision risk early warning is critical to sailing safety in vessel encounter situations because it provides ship officers with sufficient time to react to emergencies and take evasive actions in advance. In this study, we take spatiotemporal motion behaviors of encountering vessels into account since vessel motion behaviors have great influences on the occurrence of a dangerous situation. For this purpose, a datadriven approach is proposed to associate the motion behaviors with the future risk and early prediction of risk is achieved through classifying the behaviors into corresponding risk level. Specifically, we first derive a sequence of relative motion features between encountering vessels to characterize the spatial interactions that vary over time. Then a novel deep learning architecture, which combines bidirectional long short-term memory (BiLSTM) and attention mechanism, is developed to capture the spatial-temporal dependences of behaviors as well as their impacts on future risk. In particular, the BiLSTM is able to discover correlations among behaviors and the attention mechanism can emphasize the key information relevant to the risk prediction task. Exploiting the advantages of these two mechanisms makes the risk prediction more reasonable and reliable. Extensive experiments using ship trace data from the Yangtze River Estuary demonstrate that the proposed Attention-BiLSTM approach outperforms conventional LSTM in terms of accuracy and stability. Moreover, the real-time capability of the approach gives it a significant potential for use in predicting collisions at the early stages.