The first observation of the B 0 s →D 0 K þ K − decay is reported, together with the most precise branching fraction measurement of the mode B 0 →D 0 K þ K −. The results are obtained from an analysis of pp collision data corresponding to an integrated luminosity of 3.0 fb −1. The data were collected with the LHCb detector at center-of-mass energies of 7 and 8 TeV. The branching fraction of the B 0 →D 0 K þ K − decay is measured relative to that of the decay B 0 →D 0 π þ π − to be BðB 0 →D 0 K þ K − Þ BðB 0 →D 0 π þ π − Þ ¼ ð6.9 AE 0.4 AE 0.3Þ%, where the first uncertainty is statistical and the second is systematic. The measured branching fraction of the B 0 s →D 0 K þ K − decay mode relative to that of the corresponding B 0 decay is BðB 0 s →D 0 K þ K − Þ BðB 0 →D 0 K þ K − Þ ¼ ð93.0 AE 8.9 AE 6.9Þ%. Using the known branching fraction of B 0 →D 0 π þ π − , the values of BðB 0 →D 0 K þ K − Þ ¼ ð6.1AE0.4AE0.3AE0.3Þ×10 −5 and BðB 0 s →D 0 K þ K − Þ ¼ ð5.7AE0.5AE0.4AE0.5Þ×10 −5 are obtained, where the third uncertainties arise from the branching fraction of the decay modes B 0 →D 0 π þ π − and B 0 →D 0 K þ K − , respectively.