<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2024 Workiva-->
<!--r:5e52992d-6909-4bb5-bc07-2db53debac06,g:33a68087-104e-469b-a7c2-36e1a0b11b72-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member"/>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMELOSS" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMELOSS"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMELOSS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_48b43ced-5644-4290-9028-5d4f03544bb7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_StatementTable_48b43ced-5644-4290-9028-5d4f03544bb7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductOrServiceAxis_6d176c68-815d-4912-9caa-ad5864b44a65" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ProductOrServiceAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_48b43ced-5644-4290-9028-5d4f03544bb7" xlink:to="loc_srt_ProductOrServiceAxis_6d176c68-815d-4912-9caa-ad5864b44a65" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductsAndServicesDomain_6d176c68-815d-4912-9caa-ad5864b44a65_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ProductsAndServicesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ProductOrServiceAxis_6d176c68-815d-4912-9caa-ad5864b44a65" xlink:to="loc_srt_ProductsAndServicesDomain_6d176c68-815d-4912-9caa-ad5864b44a65_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ProductsAndServicesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ProductOrServiceAxis_6d176c68-815d-4912-9caa-ad5864b44a65" xlink:to="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiduciaryAndTrustMember_7009aa5e-44b9-40b3-a754-86df90113774" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiduciaryAndTrustMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:to="loc_us-gaap_FiduciaryAndTrustMember_7009aa5e-44b9-40b3-a754-86df90113774" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebitCardMember_f4fb1799-8e37-49db-8ad2-a3a84d345e06" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebitCardMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:to="loc_us-gaap_DebitCardMember_f4fb1799-8e37-49db-8ad2-a3a84d345e06" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepositAccountMember_457d29bc-ea69-44dd-a188-0c9e2ec80834" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DepositAccountMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:to="loc_us-gaap_DepositAccountMember_457d29bc-ea69-44dd-a188-0c9e2ec80834" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MerchantInterchangeFeesNetMember_fe4a664f-80d4-4599-9346-666f2af1963b" xlink:href="bmrc-20231231.xsd#bmrc_MerchantInterchangeFeesNetMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_e85d769c-ddf1-4671-8363-cdeb556eac8f" xlink:to="loc_bmrc_MerchantInterchangeFeesNetMember_fe4a664f-80d4-4599-9346-666f2af1963b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestAndDividendIncomeOperatingAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestAndFeeIncomeLoansAndLeases_2a721d7e-20c8-471e-8fdb-3d116d31cdf9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestAndFeeIncomeLoansAndLeases"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:to="loc_us-gaap_InterestAndFeeIncomeLoansAndLeases_2a721d7e-20c8-471e-8fdb-3d116d31cdf9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeOperating_ac16554f-5069-4004-af2a-cf31b0ef2ce5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestIncomeOperating"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:to="loc_us-gaap_InterestIncomeOperating_ac16554f-5069-4004-af2a-cf31b0ef2ce5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestDueFromBanksAndOther_5725f8aa-5be0-4a3f-9e48-cd266f76e128" xlink:href="bmrc-20231231.xsd#bmrc_InterestDueFromBanksAndOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:to="loc_bmrc_InterestDueFromBanksAndOther_5725f8aa-5be0-4a3f-9e48-cd266f76e128" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestAndDividendIncomeOperating_ba1f4849-477b-4b3d-a010-bc49030bbd97" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestAndDividendIncomeOperating"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestAndDividendIncomeOperatingAbstract_f014a218-1944-4ce0-af90-22f42622b818" xlink:to="loc_us-gaap_InterestAndDividendIncomeOperating_ba1f4849-477b-4b3d-a010-bc49030bbd97" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseNegotiableOrderOfWithdrawalNOWDeposits_00ab338e-b5c4-4bc9-8d27-dca9d733ae1e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseNegotiableOrderOfWithdrawalNOWDeposits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseNegotiableOrderOfWithdrawalNOWDeposits_00ab338e-b5c4-4bc9-8d27-dca9d733ae1e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseSavingsDeposits_2c76e50a-1753-4c23-b5a0-862b5a8d6dee" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseSavingsDeposits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseSavingsDeposits_2c76e50a-1753-4c23-b5a0-862b5a8d6dee" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseMoneyMarketDeposits_5af88200-2f14-43b9-a3de-49c4c2ce393e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseMoneyMarketDeposits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseMoneyMarketDeposits_5af88200-2f14-43b9-a3de-49c4c2ce393e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseTimeDeposits_fe12efd0-bada-469f-8384-25e907129966" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseTimeDeposits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseTimeDeposits_fe12efd0-bada-469f-8384-25e907129966" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseBorrowings_62ca89c6-1d1e-4a42-baae-82694b38f231" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseBorrowings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseBorrowings_62ca89c6-1d1e-4a42-baae-82694b38f231" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseTrustPreferredSecurities_8214699a-5a9d-41ee-87f7-3a0b4431c2b6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseTrustPreferredSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpenseTrustPreferredSecurities_8214699a-5a9d-41ee-87f7-3a0b4431c2b6" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_cb4695a3-d867-4bdc-b9bd-39cebb082ef6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InterestExpenseAbstract_9485496f-bbe5-4647-b836-e57dc52886a6" xlink:to="loc_us-gaap_InterestExpense_cb4695a3-d867-4bdc-b9bd-39cebb082ef6" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseNet_5abb5a96-e83c-4bd7-8ea9-b001f3339f9d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestIncomeExpenseNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_InterestIncomeExpenseNet_5abb5a96-e83c-4bd7-8ea9-b001f3339f9d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal_12bcc3d1-1a81-4ae9-9a0f-dd467ebd4add" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal_12bcc3d1-1a81-4ae9-9a0f-dd467ebd4add" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ProvisionForReversalOfLossesOnUnfundedLoanCommitments_6da7d646-1286-4956-97f6-8cde0457df89" xlink:href="bmrc-20231231.xsd#bmrc_ProvisionForReversalOfLossesOnUnfundedLoanCommitments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_bmrc_ProvisionForReversalOfLossesOnUnfundedLoanCommitments_6da7d646-1286-4956-97f6-8cde0457df89" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestIncomeExpenseAfterProvisionForLoanLoss_6d45571a-3c89-44e0-a433-81fadf7e05d9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestIncomeExpenseAfterProvisionForLoanLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_InterestIncomeExpenseAfterProvisionForLoanLoss_6d45571a-3c89-44e0-a433-81fadf7e05d9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestIncomeAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromContractWithCustomerIncludingAssessedTax_ca21c319-9765-4f47-afb6-72d68e380538" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RevenueFromContractWithCustomerIncludingAssessedTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_us-gaap_RevenueFromContractWithCustomerIncludingAssessedTax_ca21c319-9765-4f47-afb6-72d68e380538" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BankOwnedLifeInsuranceIncome_e74436b8-ae04-43e2-834d-7cd78063a545" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BankOwnedLifeInsuranceIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_us-gaap_BankOwnedLifeInsuranceIncome_e74436b8-ae04-43e2-834d-7cd78063a545" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DividendIncomeFederalHomeLoanBank_3ae3ac19-49ed-4c49-841a-d7ab23b58e3f" xlink:href="bmrc-20231231.xsd#bmrc_DividendIncomeFederalHomeLoanBank"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_bmrc_DividendIncomeFederalHomeLoanBank_3ae3ac19-49ed-4c49-841a-d7ab23b58e3f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtAndEquitySecuritiesGainLoss_3c5bb3a5-81fd-4116-b80d-94836748a74c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtAndEquitySecuritiesGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_us-gaap_DebtAndEquitySecuritiesGainLoss_3c5bb3a5-81fd-4116-b80d-94836748a74c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestIncomeOtherOperatingIncome_0d360582-b742-4726-b1b3-4b7b863cab13" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestIncomeOtherOperatingIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_us-gaap_NoninterestIncomeOtherOperatingIncome_0d360582-b742-4726-b1b3-4b7b863cab13" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestIncome_6e628016-fe52-40ec-a24e-8dd0cb181221" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestIncomeAbstract_96b01478-c92e-4fa2-97da-a5ffb7e3b20a" xlink:to="loc_us-gaap_NoninterestIncome_6e628016-fe52-40ec-a24e-8dd0cb181221" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestExpenseAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LaborAndRelatedExpense_573b9144-f63d-49df-8335-e6aa5730f17c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LaborAndRelatedExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_LaborAndRelatedExpense_573b9144-f63d-49df-8335-e6aa5730f17c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OccupancyAndEquipment_0651cb02-affd-4c50-8c6a-ff6daef83fcf" xlink:href="bmrc-20231231.xsd#bmrc_OccupancyAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_OccupancyAndEquipment_0651cb02-affd-4c50-8c6a-ff6daef83fcf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DataProcessing_df17cd63-3352-4d96-97ca-81f0150f1ef0" xlink:href="bmrc-20231231.xsd#bmrc_DataProcessing"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_DataProcessing_df17cd63-3352-4d96-97ca-81f0150f1ef0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProfessionalFees_bb1e1a52-7203-494b-891f-88f4ccd6da7f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ProfessionalFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_ProfessionalFees_bb1e1a52-7203-494b-891f-88f4ccd6da7f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DepositNetworkFees_48eaf3f4-187a-43b3-9052-bf6aed790600" xlink:href="bmrc-20231231.xsd#bmrc_DepositNetworkFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_DepositNetworkFees_48eaf3f4-187a-43b3-9052-bf6aed790600" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DepreciationDepletionAndAmortizationNonproductionExcludingAmortizationOfIntangibleAssets_d20a374b-ba27-4ee5-ac20-70be41b2ae7c" xlink:href="bmrc-20231231.xsd#bmrc_DepreciationDepletionAndAmortizationNonproductionExcludingAmortizationOfIntangibleAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_DepreciationDepletionAndAmortizationNonproductionExcludingAmortizationOfIntangibleAssets_d20a374b-ba27-4ee5-ac20-70be41b2ae7c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InformationTechnology_0d0bf2dc-1835-4338-872c-8e601dd8537b" xlink:href="bmrc-20231231.xsd#bmrc_InformationTechnology"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_InformationTechnology_0d0bf2dc-1835-4338-872c-8e601dd8537b" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfIntangibleAssets_30126c9d-259f-4783-a3d0-2b5b02465b50" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationOfIntangibleAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_AmortizationOfIntangibleAssets_30126c9d-259f-4783-a3d0-2b5b02465b50" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestExpenseDirectorsFees_f29753ad-666e-45cd-bd98-54b324320cfb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestExpenseDirectorsFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_NoninterestExpenseDirectorsFees_f29753ad-666e-45cd-bd98-54b324320cfb" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalDepositInsuranceCorporationPremiumExpense_f07d0efd-c739-4c55-9192-a19e99972bd2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalDepositInsuranceCorporationPremiumExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_FederalDepositInsuranceCorporationPremiumExpense_f07d0efd-c739-4c55-9192-a19e99972bd2" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CharitableContributionsExpense_dbbe5d97-6da2-4504-8382-54845f249c63" xlink:href="bmrc-20231231.xsd#bmrc_CharitableContributionsExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_CharitableContributionsExpense_dbbe5d97-6da2-4504-8382-54845f249c63" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherRealEstateOwnedExpense_30d3a65f-6b26-4f8b-89ef-3d2c41eacff5" xlink:href="bmrc-20231231.xsd#bmrc_OtherRealEstateOwnedExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_bmrc_OtherRealEstateOwnedExpense_30d3a65f-6b26-4f8b-89ef-3d2c41eacff5" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNoninterestExpense_abab3e29-1e2b-4c3f-b117-3a61847f8fae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherNoninterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_OtherNoninterestExpense_abab3e29-1e2b-4c3f-b117-3a61847f8fae" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestExpense_0c43fae9-45d3-47c5-a482-50f4509ec537" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NoninterestExpenseAbstract_78147f5c-a613-44f4-8d26-eb90f047fa92" xlink:to="loc_us-gaap_NoninterestExpense_0c43fae9-45d3-47c5-a482-50f4509ec537" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a303ecfc-9400-4609-83ee-f37199376d32" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a303ecfc-9400-4609-83ee-f37199376d32" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_d0bb6a0e-9653-4891-b5ff-8a1c3f8ce355" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_d0bb6a0e-9653-4891-b5ff-8a1c3f8ce355" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_a059a321-c198-44a8-a4f3-d8861133c70e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_NetIncomeLoss_a059a321-c198-44a8-a4f3-d8861133c70e" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareAbstract_febb4c31-0356-49de-9ddb-76d68194ac81" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_EarningsPerShareAbstract_febb4c31-0356-49de-9ddb-76d68194ac81" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_82316398-43b6-445b-8b72-420993b8e5e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareAbstract_febb4c31-0356-49de-9ddb-76d68194ac81" xlink:to="loc_us-gaap_EarningsPerShareBasic_82316398-43b6-445b-8b72-420993b8e5e0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_4355e17e-ff37-4618-9a0d-f13cb245f802" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareAbstract_febb4c31-0356-49de-9ddb-76d68194ac81" xlink:to="loc_us-gaap_EarningsPerShareDiluted_4355e17e-ff37-4618-9a0d-f13cb245f802" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_c94825cc-b5f0-42da-9593-52fd418f386f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_c94825cc-b5f0-42da-9593-52fd418f386f" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_e4395fea-9db6-48c7-b0e0-59602b0b3303" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_c94825cc-b5f0-42da-9593-52fd418f386f" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_e4395fea-9db6-48c7-b0e0-59602b0b3303" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_57f650f1-5c31-454d-98e5-75a046a0e158" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract_c94825cc-b5f0-42da-9593-52fd418f386f" xlink:to="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_57f650f1-5c31-454d-98e5-75a046a0e158" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTaxAbstract_0e997588-df88-42a5-a4b1-3ade05faa097" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ComprehensiveIncomeNetOfTaxAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_61df52a7-ad76-4020-b6e2-382ca933966e" xlink:to="loc_us-gaap_ComprehensiveIncomeNetOfTaxAbstract_0e997588-df88-42a5-a4b1-3ade05faa097" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_1801396c-c65a-4330-9ca1-d18e0ed45132" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTaxAbstract_0e997588-df88-42a5-a4b1-3ade05faa097" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodBeforeTax_b5ed84ae-37c4-4b90-9ede-c72a9ee7c027" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodBeforeTax_b5ed84ae-37c4-4b90-9ede-c72a9ee7c027" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesBeforeTax_5593e10a-9ef1-4761-a9fb-cbe238c33f98" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesBeforeTax_5593e10a-9ef1-4761-a9fb-cbe238c33f98" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentGainOrLossesFairValueHedge_2660e620-8a18-4c6f-b79a-274ca7d9b7d8" xlink:href="bmrc-20231231.xsd#bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentGainOrLossesFairValueHedge"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentGainOrLossesFairValueHedge_2660e620-8a18-4c6f-b79a-274ca7d9b7d8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForInvestmentTransferredFromAvailableForSaleToHeldToMaturityBeforeTax_5e77f0ed-8acd-488c-8377-3dc23672076e" xlink:href="bmrc-20231231.xsd#bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForInvestmentTransferredFromAvailableForSaleToHeldToMaturityBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_bmrc_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForInvestmentTransferredFromAvailableForSaleToHeldToMaturityBeforeTax_5e77f0ed-8acd-488c-8377-3dc23672076e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AmortizationOfNetUnrealizedLossOnAvailableForSaleSecuritiesTransferredToHeldToMaturity_fd75a95c-6aa4-491e-900f-2dfda892a373" xlink:href="bmrc-20231231.xsd#bmrc_AmortizationOfNetUnrealizedLossOnAvailableForSaleSecuritiesTransferredToHeldToMaturity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_bmrc_AmortizationOfNetUnrealizedLossOnAvailableForSaleSecuritiesTransferredToHeldToMaturity_fd75a95c-6aa4-491e-900f-2dfda892a373" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentBeforeTaxPortionAttributableToParent_9f1c678c-9ed7-4b46-94ab-b6f401217dbc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentBeforeTaxPortionAttributableToParent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentBeforeTaxPortionAttributableToParent_9f1c678c-9ed7-4b46-94ab-b6f401217dbc" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesTaxPortionAttributableToParent_26317b88-9a94-4377-a7bd-e1a0a8243036" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesTaxPortionAttributableToParent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesTaxPortionAttributableToParent_26317b88-9a94-4377-a7bd-e1a0a8243036" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_e0535ff5-d892-4024-b8c1-135f5e69c9c6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_be30007d-2ead-4a05-9c9c-66e2c79b4094" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_e0535ff5-d892-4024-b8c1-135f5e69c9c6" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_a6871bdc-624a-453a-9c5e-4399cef41668" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTaxAbstract_0e997588-df88-42a5-a4b1-3ade05faa097" xlink:to="loc_us-gaap_ComprehensiveIncomeNetOfTax_a6871bdc-624a-453a-9c5e-4399cef41668" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CONSOLIDATEDSTATEMENTOFCHANGESINSTOCKHOLDERSEQUITY" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CONSOLIDATEDSTATEMENTOFCHANGESINSTOCKHOLDERSEQUITY"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CONSOLIDATEDSTATEMENTOFCHANGESINSTOCKHOLDERSEQUITY" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_56256c18-e811-4e45-9002-d0b6383fa725" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_be497fb1-0d1c-4bc6-a801-2fe933fefe68" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_56256c18-e811-4e45-9002-d0b6383fa725" xlink:to="loc_us-gaap_StatementTable_be497fb1-0d1c-4bc6-a801-2fe933fefe68" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_ce821893-2b7f-47e5-bf3b-535e513d353a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_be497fb1-0d1c-4bc6-a801-2fe933fefe68" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_ce821893-2b7f-47e5-bf3b-535e513d353a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_ce821893-2b7f-47e5-bf3b-535e513d353a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_ce821893-2b7f-47e5-bf3b-535e513d353a" xlink:to="loc_us-gaap_EquityComponentDomain_ce821893-2b7f-47e5-bf3b-535e513d353a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_b1344bad-c176-4691-ba07-47f5058d4ed2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_ce821893-2b7f-47e5-bf3b-535e513d353a" xlink:to="loc_us-gaap_EquityComponentDomain_b1344bad-c176-4691-ba07-47f5058d4ed2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_5403089d-9415-4a98-919e-48c867e73ac4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b1344bad-c176-4691-ba07-47f5058d4ed2" xlink:to="loc_us-gaap_CommonStockMember_5403089d-9415-4a98-919e-48c867e73ac4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_29490d0e-0e33-4c59-980e-0895360754e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b1344bad-c176-4691-ba07-47f5058d4ed2" xlink:to="loc_us-gaap_RetainedEarningsMember_29490d0e-0e33-4c59-980e-0895360754e0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_5cf095b5-12d9-4617-b0c2-ee4bab406718" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b1344bad-c176-4691-ba07-47f5058d4ed2" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_5cf095b5-12d9-4617-b0c2-ee4bab406718" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_56256c18-e811-4e45-9002-d0b6383fa725" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesOutstanding_f3528c6b-9ad5-44a5-af76-d9c3957c5c53" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_CommonStockSharesOutstanding_f3528c6b-9ad5-44a5-af76-d9c3957c5c53" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_f8625c40-31fc-46a7-8936-4f3a65369345" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockholdersEquity_f8625c40-31fc-46a7-8936-4f3a65369345" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_fa766756-c941-4524-94c1-b82b5943d8e8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_NetIncomeLoss_fa766756-c941-4524-94c1-b82b5943d8e8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_359b284b-b097-47ce-a3b3-14f869aeb4e4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_359b284b-b097-47ce-a3b3-14f869aeb4e4" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings_1523db2a-6fdd-4b48-abae-9866a847cd0b" xlink:href="bmrc-20231231.xsd#bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings_1523db2a-6fdd-4b48-abae-9866a847cd0b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedDuringPeriodValueStockOptionsExercisedNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings_95e2454c-8f85-45ed-93a1-fe68f2a3aa82" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedDuringPeriodValueStockOptionsExercisedNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_StockIssuedDuringPeriodValueStockOptionsExercisedNetOfSharesSurrenderedForCashlessExercisesAndTaxWithholdings_95e2454c-8f85-45ed-93a1-fe68f2a3aa82" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlans_00c0a724-42d5-44ee-ac5d-4ef8b27e66bb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlans"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlans_00c0a724-42d5-44ee-ac5d-4ef8b27e66bb" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan_8cad31bd-cb8d-41d8-a91a-3e1e35a7f694" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockPurchasePlan_8cad31bd-cb8d-41d8-a91a-3e1e35a7f694" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesEmployeeStockOwnershipPlan_656d7b18-cc70-4f7f-8908-a6438ff495ea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesEmployeeStockOwnershipPlan"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesEmployeeStockOwnershipPlan_656d7b18-cc70-4f7f-8908-a6438ff495ea" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockOwnershipPlan_dd1c45fe-d7d0-4e4b-9ae3-9506b253e981" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodValueEmployeeStockOwnershipPlan"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueEmployeeStockOwnershipPlan_dd1c45fe-d7d0-4e4b-9ae3-9506b253e981" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardGross_e5263d91-f62f-4986-849b-62ed98704354" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardGross_e5263d91-f62f-4986-849b-62ed98704354" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation_11287412-1f78-4209-9ad2-dcac0c6d254b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_SharesPaidForTaxWithholdingForShareBasedCompensation_11287412-1f78-4209-9ad2-dcac0c6d254b" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation_25254906-7411-4a4c-a176-b01da9bb812c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_AdjustmentsRelatedToTaxWithholdingForShareBasedCompensation_25254906-7411-4a4c-a176-b01da9bb812c" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardForfeited_5f7cbe57-b6f8-4c30-8800-f999f8d31903" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardForfeited"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardForfeited_5f7cbe57-b6f8-4c30-8800-f999f8d31903" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationStockOptionsRequisiteServicePeriodRecognition_620d52fd-7073-4660-91cb-d134d72496ef" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationStockOptionsRequisiteServicePeriodRecognition"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationStockOptionsRequisiteServicePeriodRecognition_620d52fd-7073-4660-91cb-d134d72496ef" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationRestrictedStockUnitsRequisiteServicePeriodRecognition_800d12fe-b4ae-4c2d-86ed-0df1f007213c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationRestrictedStockUnitsRequisiteServicePeriodRecognition"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalShareBasedCompensationRestrictedStockUnitsRequisiteServicePeriodRecognition_800d12fe-b4ae-4c2d-86ed-0df1f007213c" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStockCash_ee4803a0-bdd9-4ff3-833f-9b008ab522c5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DividendsCommonStockCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_DividendsCommonStockCash_ee4803a0-bdd9-4ff3-833f-9b008ab522c5" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedDuringPeriodSharesNonemployeeDirectorStockPurchasePlans_6df69e86-fc2d-43b2-9a5e-955e373e313c" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedDuringPeriodSharesNonemployeeDirectorStockPurchasePlans"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_StockIssuedDuringPeriodSharesNonemployeeDirectorStockPurchasePlans_6df69e86-fc2d-43b2-9a5e-955e373e313c" xlink:type="arc" order="18"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedDuringPeriodValueNonemployeeDirectorStockPurchasePlans_76e3fa2d-0d10-4a9b-93ae-a89becf05aad" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedDuringPeriodValueNonemployeeDirectorStockPurchasePlans"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_StockIssuedDuringPeriodValueNonemployeeDirectorStockPurchasePlans_76e3fa2d-0d10-4a9b-93ae-a89becf05aad" xlink:type="arc" order="19"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedInPaymentOfDirectorFeesShares_e7b0f467-67cd-4dea-a2a2-5d3672107c94" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedInPaymentOfDirectorFeesShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_StockIssuedInPaymentOfDirectorFeesShares_e7b0f467-67cd-4dea-a2a2-5d3672107c94" xlink:type="arc" order="20"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedInPaymentOfDirectorFees_8960770f-302a-4865-a946-31e9d4758ae8" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedInPaymentOfDirectorFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_bmrc_StockIssuedInPaymentOfDirectorFees_8960770f-302a-4865-a946-31e9d4758ae8" xlink:type="arc" order="21"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_9a338d2c-b0cc-4992-8ae6-e6094cb3a34f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesNewIssues"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_9a338d2c-b0cc-4992-8ae6-e6094cb3a34f" xlink:type="arc" order="22"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueNewIssues_5c353d92-eb40-415f-83b8-2fc2699336bf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodValueNewIssues"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueNewIssues_5c353d92-eb40-415f-83b8-2fc2699336bf" xlink:type="arc" order="23"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodShares_22970370-3960-49e8-84ca-1234f74ff7d2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockRepurchasedDuringPeriodShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodShares_22970370-3960-49e8-84ca-1234f74ff7d2" xlink:type="arc" order="24"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_0b455b99-2a2c-43ba-92dc-33e90b512a31" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_6a0857aa-bd2f-4521-a052-7e64d0057f97" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_0b455b99-2a2c-43ba-92dc-33e90b512a31" xlink:type="arc" order="25"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesOutstanding_923ef5d1-935c-4989-9269-0e8dca83cd84" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_bb6cc86f-7952-4957-ac3f-9aa724c83a9b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockholdersEquity"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesPremisesandEquipmentDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#SummaryofSignificantAccountingPoliciesPremisesandEquipmentDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesPremisesandEquipmentDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems_2135a954-2279-40e7-8e87-06a2fe572857" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_f761f33e-60f6-4bdb-847e-31c7d1da465f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_2135a954-2279-40e7-8e87-06a2fe572857" xlink:to="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_f761f33e-60f6-4bdb-847e-31c7d1da465f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_f761f33e-60f6-4bdb-847e-31c7d1da465f" xlink:to="loc_srt_RangeAxis_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54" xlink:to="loc_srt_RangeMember_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_6c1b549b-c572-443f-9a3b-4da862bc8c4d" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_599b1a05-0e84-4b19-9ac5-6e1b0bd1aa54" xlink:to="loc_srt_RangeMember_6c1b549b-c572-443f-9a3b-4da862bc8c4d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_96a917d0-d905-4749-9c9f-90749239811e" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_6c1b549b-c572-443f-9a3b-4da862bc8c4d" xlink:to="loc_srt_MinimumMember_96a917d0-d905-4749-9c9f-90749239811e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_084dabd6-0f2c-43ab-93b4-acdf792c6a0a" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_6c1b549b-c572-443f-9a3b-4da862bc8c4d" xlink:to="loc_srt_MaximumMember_084dabd6-0f2c-43ab-93b4-acdf792c6a0a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_f761f33e-60f6-4bdb-847e-31c7d1da465f" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_15641e64-2fe2-4e37-9a46-9d382d95691c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_5ab9fde5-f7ce-4f26-a197-aabcb3a8460f" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_15641e64-2fe2-4e37-9a46-9d382d95691c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FurnitureAndFixturesMember_42fbad27-475f-4741-a3d3-25366af66893" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FurnitureAndFixturesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_15641e64-2fe2-4e37-9a46-9d382d95691c" xlink:to="loc_us-gaap_FurnitureAndFixturesMember_42fbad27-475f-4741-a3d3-25366af66893" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquipmentMember_aa00f85b-ae51-4dfc-b353-9ff061243b34" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquipmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_15641e64-2fe2-4e37-9a46-9d382d95691c" xlink:to="loc_us-gaap_EquipmentMember_aa00f85b-ae51-4dfc-b353-9ff061243b34" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BuildingMember_4c00dbc5-c6ed-4454-8fd3-fada09a53b56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BuildingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_15641e64-2fe2-4e37-9a46-9d382d95691c" xlink:to="loc_us-gaap_BuildingMember_4c00dbc5-c6ed-4454-8fd3-fada09a53b56" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_b0fe2011-5235-4205-9d02-3f9b3c4d8be2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_2135a954-2279-40e7-8e87-06a2fe572857" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_b0fe2011-5235-4205-9d02-3f9b3c4d8be2" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesGoodwillandOtherIntangibleAssetsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#SummaryofSignificantAccountingPoliciesGoodwillandOtherIntangibleAssetsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesGoodwillandOtherIntangibleAssetsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_e89574d9-5818-4e5b-ab26-5db6c598f0ff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_e89574d9-5818-4e5b-ab26-5db6c598f0ff" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_e89574d9-5818-4e5b-ab26-5db6c598f0ff" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_fbbf5ded-1fb6-4b43-a2fc-1deba699222d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_fd380b42-b5f9-42a7-8a33-8c9b83e64fa3" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_fbbf5ded-1fb6-4b43-a2fc-1deba699222d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CoreDepositsMember_25895365-23dd-4c7a-acd5-f8e64f0c47f0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CoreDepositsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_fbbf5ded-1fb6-4b43-a2fc-1deba699222d" xlink:to="loc_us-gaap_CoreDepositsMember_25895365-23dd-4c7a-acd5-f8e64f0c47f0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_4595c6df-9f99-4c4c-a375-38b79d223538" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:to="loc_us-gaap_Goodwill_4595c6df-9f99-4c4c-a375-38b79d223538" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GoodwillImpairmentLoss_d86ced21-ee0a-4a11-94ab-b03ea1ae1e68" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GoodwillImpairmentLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:to="loc_us-gaap_GoodwillImpairmentLoss_d86ced21-ee0a-4a11-94ab-b03ea1ae1e68" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_7ef2b5c5-01f1-4372-8348-b2187aa91991" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetUsefulLife"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetUsefulLife_7ef2b5c5-01f1-4372-8348-b2187aa91991" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ImpairmentOfIntangibleAssetsFinitelived_a4b45067-4678-4bd3-be62-49f3bdd20740" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ImpairmentOfIntangibleAssetsFinitelived"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_0164c97b-874e-43f8-84ce-61456af859e6" xlink:to="loc_us-gaap_ImpairmentOfIntangibleAssetsFinitelived_a4b45067-4678-4bd3-be62-49f3bdd20740" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesFutureAmortizationExpenseofCoreDepositsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#SummaryofSignificantAccountingPoliciesFutureAmortizationExpenseofCoreDepositsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesFutureAmortizationExpenseofCoreDepositsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_b57bdc13-a769-4bbb-888e-a8e5fa34e940" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_b57bdc13-a769-4bbb-888e-a8e5fa34e940" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c2d351e-37c6-4331-8c91-3c87d7f0debc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_b57bdc13-a769-4bbb-888e-a8e5fa34e940" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c2d351e-37c6-4331-8c91-3c87d7f0debc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_2c2d351e-37c6-4331-8c91-3c87d7f0debc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c2d351e-37c6-4331-8c91-3c87d7f0debc" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_2c2d351e-37c6-4331-8c91-3c87d7f0debc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_a0872c8f-062e-419d-9010-acc396d1095c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsByMajorClassAxis_2c2d351e-37c6-4331-8c91-3c87d7f0debc" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_a0872c8f-062e-419d-9010-acc396d1095c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CoreDepositsMember_cc168e93-c5cd-4e6b-a5e3-8931cfc7f7ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CoreDepositsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsMajorClassNameDomain_a0872c8f-062e-419d-9010-acc396d1095c" xlink:to="loc_us-gaap_CoreDepositsMember_cc168e93-c5cd-4e6b-a5e3-8931cfc7f7ce" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_7172ac18-9fc7-4a5f-b008-aa8bfb24fa22" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseNextTwelveMonths_7172ac18-9fc7-4a5f-b008-aa8bfb24fa22" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_16972be4-86dd-477f-8948-e47b56c42d98" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearTwo_16972be4-86dd-477f-8948-e47b56c42d98" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_262bc849-5664-47a2-8693-c9597b521b39" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearThree_262bc849-5664-47a2-8693-c9597b521b39" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_c0fc3020-e80d-4a0b-b0eb-c13662724bda" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFour_c0fc3020-e80d-4a0b-b0eb-c13662724bda" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_c0cc30df-54c3-42b2-98b8-9d17830b92e1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseYearFive_c0cc30df-54c3-42b2-98b8-9d17830b92e1" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_adc71e91-fb93-474f-b04b-a3681567a519" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsAmortizationExpenseAfterYearFive_adc71e91-fb93-474f-b04b-a3681567a519" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsNet_428bf4aa-8f7d-4af6-a706-311fa22c99ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FiniteLivedIntangibleAssetsNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_fa7874ee-0d44-418e-966f-255bfce7a973" xlink:to="loc_us-gaap_FiniteLivedIntangibleAssetsNet_428bf4aa-8f7d-4af6-a706-311fa22c99ce" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesInvestmentsinLowIncomeHousingTaxCreditFundsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#SummaryofSignificantAccountingPoliciesInvestmentsinLowIncomeHousingTaxCreditFundsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/SummaryofSignificantAccountingPoliciesInvestmentsinLowIncomeHousingTaxCreditFundsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherOwnershipInterestsLineItems_dced1ecb-e864-44fb-aa26-c93df39b391b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherOwnershipInterestsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfOtherOwnershipInterestsTable_4dbbc5fe-abae-49b9-992a-3b28374196b0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfOtherOwnershipInterestsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_OtherOwnershipInterestsLineItems_dced1ecb-e864-44fb-aa26-c93df39b391b" xlink:to="loc_us-gaap_ScheduleOfOtherOwnershipInterestsTable_4dbbc5fe-abae-49b9-992a-3b28374196b0" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_c759b7c2-e314-43a7-a06c-45e86d20b239" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfOtherOwnershipInterestsTable_4dbbc5fe-abae-49b9-992a-3b28374196b0" xlink:to="loc_srt_RangeAxis_c759b7c2-e314-43a7-a06c-45e86d20b239" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c759b7c2-e314-43a7-a06c-45e86d20b239_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_c759b7c2-e314-43a7-a06c-45e86d20b239" xlink:to="loc_srt_RangeMember_c759b7c2-e314-43a7-a06c-45e86d20b239_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_01f26419-6284-4cbe-bf67-f5e5e0d8ad12" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_c759b7c2-e314-43a7-a06c-45e86d20b239" xlink:to="loc_srt_RangeMember_01f26419-6284-4cbe-bf67-f5e5e0d8ad12" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_17d52854-d96d-4240-a8f2-effb58aa6485" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_01f26419-6284-4cbe-bf67-f5e5e0d8ad12" xlink:to="loc_srt_MinimumMember_17d52854-d96d-4240-a8f2-effb58aa6485" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_cb295d9a-1301-4a46-a21b-0b222500b7f4" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_01f26419-6284-4cbe-bf67-f5e5e0d8ad12" xlink:to="loc_srt_MaximumMember_cb295d9a-1301-4a46-a21b-0b222500b7f4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AffordableHousingTaxCreditsInvestmentOwnershipPercentage_3030e618-44d2-449e-acbf-56dfaf1ca851" xlink:href="bmrc-20231231.xsd#bmrc_AffordableHousingTaxCreditsInvestmentOwnershipPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherOwnershipInterestsLineItems_dced1ecb-e864-44fb-aa26-c93df39b391b" xlink:to="loc_bmrc_AffordableHousingTaxCreditsInvestmentOwnershipPercentage_3030e618-44d2-449e-acbf-56dfaf1ca851" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesHeldtoMaturityAmortizedCostandFairValueDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesHeldtoMaturityAmortizedCostandFairValueDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesHeldtoMaturityAmortizedCostandFairValueDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_0cbaee34-e454-411c-bea8-a432bcda60de" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_0cbaee34-e454-411c-bea8-a432bcda60de" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_f1912c4d-7000-4ef3-b3f3-88a443e6f43d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_0cbaee34-e454-411c-bea8-a432bcda60de" xlink:to="loc_us-gaap_FinancialInstrumentAxis_f1912c4d-7000-4ef3-b3f3-88a443e6f43d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f1912c4d-7000-4ef3-b3f3-88a443e6f43d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_f1912c4d-7000-4ef3-b3f3-88a443e6f43d" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_f1912c4d-7000-4ef3-b3f3-88a443e6f43d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_f1912c4d-7000-4ef3-b3f3-88a443e6f43d" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:href="bmrc-20231231.xsd#bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:to="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_836da6c3-89d3-47c2-870e-bd68db77025c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:to="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_836da6c3-89d3-47c2-870e-bd68db77025c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_71c89957-ec9f-4362-81dd-c10dfba0d656" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:to="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_71c89957-ec9f-4362-81dd-c10dfba0d656" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_60550562-f6b0-4373-aecd-2bc0ec49d333" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:to="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_60550562-f6b0-4373-aecd-2bc0ec49d333" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember_a2d36713-c29d-4481-8315-e82736373916" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:to="loc_us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember_a2d36713-c29d-4481-8315-e82736373916" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_7aa84532-b53d-4745-b54d-88d0fed986f9" xlink:href="bmrc-20231231.xsd#bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_00e8ce90-60d4-45c3-bcaf-cacd5867e519" xlink:to="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_7aa84532-b53d-4745-b54d-88d0fed986f9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_e941525c-c213-4f1d-9ef2-bf8066eb5db3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:to="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_e941525c-c213-4f1d-9ef2-bf8066eb5db3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_ba37bb85-9060-4def-aef8-3eb64224147e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_ba37bb85-9060-4def-aef8-3eb64224147e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_078f5e7e-904b-4be6-b876-13fd6ffd7a56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_fdad7aa9-3bfa-418e-8c63-fd863894830f" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_078f5e7e-904b-4be6-b876-13fd6ffd7a56" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss_9aa62e4e-e3ca-4ffc-bf5b-243dcf01532a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss_9aa62e4e-e3ca-4ffc-bf5b-243dcf01532a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest_639d87df-a42d-4014-81ed-ede0e181659d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest_639d87df-a42d-4014-81ed-ede0e181659d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestAfterAllowanceForCreditLoss_2b038e0b-997f-412e-8a9c-3833adb56b43" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestAfterAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestAfterAllowanceForCreditLoss_2b038e0b-997f-412e-8a9c-3833adb56b43" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingGain_5eb6c6bc-16f2-4021-bd9b-948cb58b0438" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingGain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingGain_5eb6c6bc-16f2-4021-bd9b-948cb58b0438" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingLoss_b167db00-9279-4066-a68d-fc018fe9edc9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesAccumulatedUnrecognizedHoldingLoss_b167db00-9279-4066-a68d-fc018fe9edc9" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesFairValue_c538bef8-613a-421b-96da-d935bbaeffa4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesFairValue_c538bef8-613a-421b-96da-d935bbaeffa4" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityAccruedInterestBeforeAllowanceForCreditLoss_868fb903-dbb2-408c-bcee-7e113ecdd1d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_23321b26-c7f7-4ad7-8d35-94a11a26a286" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityAccruedInterestBeforeAllowanceForCreditLoss_868fb903-dbb2-408c-bcee-7e113ecdd1d8" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_75529b89-a3d5-435c-8e29-56a6f24cfa9c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_75529b89-a3d5-435c-8e29-56a6f24cfa9c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_e6aa016e-1779-4583-a259-148b57e704d6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_75529b89-a3d5-435c-8e29-56a6f24cfa9c" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_e6aa016e-1779-4583-a259-148b57e704d6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_e6aa016e-1779-4583-a259-148b57e704d6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_e6aa016e-1779-4583-a259-148b57e704d6" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_e6aa016e-1779-4583-a259-148b57e704d6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_98dc3eea-62aa-4be4-aec7-0b31b33b6478" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_e6aa016e-1779-4583-a259-148b57e704d6" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_98dc3eea-62aa-4be4-aec7-0b31b33b6478" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AccumulatedOtherComprehensiveIncomeLossNetOfTaxMember_46a051f9-9e81-4db1-b610-3822662cd1c0" xlink:href="bmrc-20231231.xsd#bmrc_AccumulatedOtherComprehensiveIncomeLossNetOfTaxMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_98dc3eea-62aa-4be4-aec7-0b31b33b6478" xlink:to="loc_bmrc_AccumulatedOtherComprehensiveIncomeLossNetOfTaxMember_46a051f9-9e81-4db1-b610-3822662cd1c0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_86a69edf-8098-4bdf-8302-01770f99753d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_75529b89-a3d5-435c-8e29-56a6f24cfa9c" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_86a69edf-8098-4bdf-8302-01770f99753d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_86a69edf-8098-4bdf-8302-01770f99753d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_86a69edf-8098-4bdf-8302-01770f99753d" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_86a69edf-8098-4bdf-8302-01770f99753d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_7cb36bca-a044-4cf2-8e19-3e333a6dccf5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_86a69edf-8098-4bdf-8302-01770f99753d" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_7cb36bca-a044-4cf2-8e19-3e333a6dccf5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateSwapMember_1f3142f2-74fb-4b11-883d-6134c0a9da82" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestRateSwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_7cb36bca-a044-4cf2-8e19-3e333a6dccf5" xlink:to="loc_us-gaap_InterestRateSwapMember_1f3142f2-74fb-4b11-883d-6134c0a9da82" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest_5e66c9c8-2eb4-41e0-9951-28d6431c88f8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossExcludingAccruedInterest_5e66c9c8-2eb4-41e0-9951-28d6431c88f8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTransferToHeldToMaturityAllowanceForCreditLossExpense_16ab4b1d-e184-47cf-addf-4c85467963c8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleTransferToHeldToMaturityAllowanceForCreditLossExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTransferToHeldToMaturityAllowanceForCreditLossExpense_16ab4b1d-e184-47cf-addf-4c85467963c8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_0a3ed8d2-bd59-473d-9a41-29959203fac8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_0a3ed8d2-bd59-473d-9a41-29959203fac8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions_317233ea-e87d-4599-bab2-e5abf49f039c" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions_317233ea-e87d-4599-bab2-e5abf49f039c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLongerThan12Months_4ff71ee2-b625-40ef-bd14-7d411f0b7b70" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLongerThan12Months"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLongerThan12Months_4ff71ee2-b625-40ef-bd14-7d411f0b7b70" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThan12Months_8cd0b69a-d005-435f-b73c-1ee216298205" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThan12Months"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_bmrc_MarketableSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThan12Months_8cd0b69a-d005-435f-b73c-1ee216298205" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAllowanceForCreditLoss_cd5cb13e-2303-42f5-8dbf-dbb9f4709a00" xlink:href="bmrc-20231231.xsd#bmrc_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_bmrc_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAllowanceForCreditLoss_cd5cb13e-2303-42f5-8dbf-dbb9f4709a00" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNotionalAmount_078bac9c-ffdd-4eb5-b840-fba2fd49519f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_f3cfdabe-fe76-4894-94cb-30ba9be084a8" xlink:to="loc_us-gaap_DerivativeNotionalAmount_078bac9c-ffdd-4eb5-b840-fba2fd49519f" xlink:type="arc" order="7"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofBondRatingsForHeldtoMaturitySecuritiesDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesScheduleofBondRatingsForHeldtoMaturitySecuritiesDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofBondRatingsForHeldtoMaturitySecuritiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorLineItems_0a4feed2-01d0-4f9d-80be-7967ea3208d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorTable_485a980e-b361-4b5d-9c1b-fc49280597d9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorLineItems_0a4feed2-01d0-4f9d-80be-7967ea3208d8" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorTable_485a980e-b361-4b5d-9c1b-fc49280597d9" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsAxis_c266eb03-e79e-4ffc-9865-eb43090d05d3" xlink:href="bmrc-20231231.xsd#bmrc_CreditRatingMoodysAndOrStandardPoorsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorTable_485a980e-b361-4b5d-9c1b-fc49280597d9" xlink:to="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsAxis_c266eb03-e79e-4ffc-9865-eb43090d05d3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_c266eb03-e79e-4ffc-9865-eb43090d05d3_default" xlink:href="bmrc-20231231.xsd#bmrc_CreditRatingMoodysAndOrStandardPoorsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsAxis_c266eb03-e79e-4ffc-9865-eb43090d05d3" xlink:to="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_c266eb03-e79e-4ffc-9865-eb43090d05d3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_da8b3159-1f56-4eeb-9c62-14025cc36426" xlink:href="bmrc-20231231.xsd#bmrc_CreditRatingMoodysAndOrStandardPoorsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsAxis_c266eb03-e79e-4ffc-9865-eb43090d05d3" xlink:to="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_da8b3159-1f56-4eeb-9c62-14025cc36426" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MoodysAndOrStandardPoorsAAARatingMember_8dbbd61b-216e-4b3e-8311-a741c197efb5" xlink:href="bmrc-20231231.xsd#bmrc_MoodysAndOrStandardPoorsAAARatingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_da8b3159-1f56-4eeb-9c62-14025cc36426" xlink:to="loc_bmrc_MoodysAndOrStandardPoorsAAARatingMember_8dbbd61b-216e-4b3e-8311-a741c197efb5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MoodysAndOrStandardPoorsAARatingMember_2df75a0e-113f-48c9-9c2d-f4fc5a389b98" xlink:href="bmrc-20231231.xsd#bmrc_MoodysAndOrStandardPoorsAARatingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_da8b3159-1f56-4eeb-9c62-14025cc36426" xlink:to="loc_bmrc_MoodysAndOrStandardPoorsAARatingMember_2df75a0e-113f-48c9-9c2d-f4fc5a389b98" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MoodysAndOrStandardPoorsARatingMember_37d332d6-88d5-4840-a72d-528c14220344" xlink:href="bmrc-20231231.xsd#bmrc_MoodysAndOrStandardPoorsARatingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_CreditRatingMoodysAndOrStandardPoorsDomain_da8b3159-1f56-4eeb-9c62-14025cc36426" xlink:to="loc_bmrc_MoodysAndOrStandardPoorsARatingMember_37d332d6-88d5-4840-a72d-528c14220344" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_680eac17-468e-4cb1-bfbb-d7bbc5371b14" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorTable_485a980e-b361-4b5d-9c1b-fc49280597d9" xlink:to="loc_us-gaap_FinancialInstrumentAxis_680eac17-468e-4cb1-bfbb-d7bbc5371b14" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_680eac17-468e-4cb1-bfbb-d7bbc5371b14_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_680eac17-468e-4cb1-bfbb-d7bbc5371b14" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_680eac17-468e-4cb1-bfbb-d7bbc5371b14_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3072ab84-aef4-4692-85fc-b2263f53e434" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_680eac17-468e-4cb1-bfbb-d7bbc5371b14" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3072ab84-aef4-4692-85fc-b2263f53e434" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_a7d529a5-2421-41b1-af8e-d3ed5f7d23c1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3072ab84-aef4-4692-85fc-b2263f53e434" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_a7d529a5-2421-41b1-af8e-d3ed5f7d23c1" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_b6bf0f96-5177-45f0-8462-70989f8ebfe7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3072ab84-aef4-4692-85fc-b2263f53e434" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_b6bf0f96-5177-45f0-8462-70989f8ebfe7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss_29b7ed95-56bd-4b2c-b4f3-1037c536a908" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtSecuritiesHeldToMaturityCreditQualityIndicatorLineItems_0a4feed2-01d0-4f9d-80be-7967ea3208d8" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityExcludingAccruedInterestBeforeAllowanceForCreditLoss_29b7ed95-56bd-4b2c-b4f3-1037c536a908" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofAvailableforSaleSecuritiesAmortizedCostandFairValueDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesScheduleofAvailableforSaleSecuritiesAmortizedCostandFairValueDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofAvailableforSaleSecuritiesAmortizedCostandFairValueDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_bc03601d-3e99-4b52-960a-66810ada5fb7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_bc03601d-3e99-4b52-960a-66810ada5fb7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_bc03601d-3e99-4b52-960a-66810ada5fb7" xlink:to="loc_us-gaap_FinancialInstrumentAxis_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_3a1325ad-fe1e-418c-b8d1-c0d9a4c6469c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:href="bmrc-20231231.xsd#bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:to="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_468e626e-bb17-49d9-80be-f16df4bdd7c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_468e626e-bb17-49d9-80be-f16df4bdd7c4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_7d1f382f-00ad-4497-8b2f-510604c0e29e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_7d1f382f-00ad-4497-8b2f-510604c0e29e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_10c8c8e7-73f4-4428-b08f-81f9993153bd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_10c8c8e7-73f4-4428-b08f-81f9993153bd" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember_a7efa3fd-458f-4966-b271-43c615c9db18" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_us-gaap_GovernmentNationalMortgageAssociationCertificatesAndObligationsGNMAMember_a7efa3fd-458f-4966-b271-43c615c9db18" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_b6427109-6e8f-4036-9929-22fd5f6188ba" xlink:href="bmrc-20231231.xsd#bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_b6427109-6e8f-4036-9929-22fd5f6188ba" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_5cfb490c-9c6b-41fc-910e-6f85b5efe758" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_SecuritiesOfUSGovernmentSponsoredEnterprisesAbstract_df1e5267-2f26-40f4-a673-47de476d34a5" xlink:to="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_5cfb490c-9c6b-41fc-910e-6f85b5efe758" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_05f63c4e-da85-4407-aa42-a5afb30957d5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_05f63c4e-da85-4407-aa42-a5afb30957d5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_5c238969-9851-4c77-a59b-da089313cfa5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_5c238969-9851-4c77-a59b-da089313cfa5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_7b4d1291-98f2-4632-924e-38d45aa4ad01" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_7b4d1291-98f2-4632-924e-38d45aa4ad01" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_3637dc78-54b3-4ac2-a48e-29b2a6c7a8ad" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2c93723d-e167-47bf-a409-283d247ee272" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_3637dc78-54b3-4ac2-a48e-29b2a6c7a8ad" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostExcludingAccruedInterestBeforeAllowanceForCreditLoss_06dfa814-fd64-4f44-a00d-2e223964fa08" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostExcludingAccruedInterestBeforeAllowanceForCreditLoss_06dfa814-fd64-4f44-a00d-2e223964fa08" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_5a1674e9-70fe-4e50-834e-dce7e8273c8f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_5a1674e9-70fe-4e50-834e-dce7e8273c8f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_cb94e401-f11c-4abe-80ed-767b738eab10" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_cb94e401-f11c-4abe-80ed-767b738eab10" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostAllowanceForCreditLossExcludingAccruedInterest_f69b8162-c36f-4bc7-8ba4-7adff9fa51ae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAmortizedCostAllowanceForCreditLossExcludingAccruedInterest_f69b8162-c36f-4bc7-8ba4-7adff9fa51ae" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_3b958ada-9ee2-4835-877d-65516ffa923e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_3b958ada-9ee2-4835-877d-65516ffa923e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList_6e422599-66b6-4c78-85f2-39489e000905" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList_6e422599-66b6-4c78-85f2-39489e000905" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss_04d88543-a7e7-440f-b34c-7c997ab34416" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_a4f851ce-8e25-4997-8b01-1764fff1a588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss_04d88543-a7e7-440f-b34c-7c997ab34416" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofPledgedandTransferredSecuritiesDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesScheduleofPledgedandTransferredSecuritiesDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofPledgedandTransferredSecuritiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_515b60d9-e2dd-4f86-8414-ac1373763bc3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_9093e5c6-2416-4cdf-9d01-f5d765735a00" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_515b60d9-e2dd-4f86-8414-ac1373763bc3" xlink:to="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_9093e5c6-2416-4cdf-9d01-f5d765735a00" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeAxis_977098f9-cad8-4ed1-8765-940f2934541d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_9093e5c6-2416-4cdf-9d01-f5d765735a00" xlink:to="loc_us-gaap_InvestmentTypeAxis_977098f9-cad8-4ed1-8765-940f2934541d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_977098f9-cad8-4ed1-8765-940f2934541d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_InvestmentTypeAxis_977098f9-cad8-4ed1-8765-940f2934541d" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_977098f9-cad8-4ed1-8765-940f2934541d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_InvestmentTypeAxis_977098f9-cad8-4ed1-8765-940f2934541d" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PledgedToStateOfCaliforniaMember_512092cc-1364-4a73-a784-efda9f3224c8" xlink:href="bmrc-20231231.xsd#bmrc_PledgedToStateOfCaliforniaMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:to="loc_bmrc_PledgedToStateOfCaliforniaMember_512092cc-1364-4a73-a784-efda9f3224c8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PublicDepositsMember_e9f134ed-b6dc-4b22-b6e4-01cdae7ec858" xlink:href="bmrc-20231231.xsd#bmrc_PublicDepositsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_PledgedToStateOfCaliforniaMember_512092cc-1364-4a73-a784-efda9f3224c8" xlink:to="loc_bmrc_PublicDepositsMember_e9f134ed-b6dc-4b22-b6e4-01cdae7ec858" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TrustDepositsMember_49b28a79-25be-4d88-a9af-ee0b0ec69592" xlink:href="bmrc-20231231.xsd#bmrc_TrustDepositsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_PledgedToStateOfCaliforniaMember_512092cc-1364-4a73-a784-efda9f3224c8" xlink:to="loc_bmrc_TrustDepositsMember_49b28a79-25be-4d88-a9af-ee0b0ec69592" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CheckingAccountWealthManagementAndTrustServicesMember_fda66f3b-cacc-40f4-ab96-2b7560ca74c4" xlink:href="bmrc-20231231.xsd#bmrc_CheckingAccountWealthManagementAndTrustServicesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_PledgedToStateOfCaliforniaMember_512092cc-1364-4a73-a784-efda9f3224c8" xlink:to="loc_bmrc_CheckingAccountWealthManagementAndTrustServicesMember_fda66f3b-cacc-40f4-ab96-2b7560ca74c4" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BankruptcyTrusteeDepositsPledgedWithFederalReserveBankMember_cab1d21e-a115-4d82-9a3b-b61f4b85f183" xlink:href="bmrc-20231231.xsd#bmrc_BankruptcyTrusteeDepositsPledgedWithFederalReserveBankMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:to="loc_bmrc_BankruptcyTrusteeDepositsPledgedWithFederalReserveBankMember_cab1d21e-a115-4d82-9a3b-b61f4b85f183" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FHLBSecuritiesBackedCreditProgramMember_86cde4fe-28aa-49a5-b85b-d0e74c1e6ea9" xlink:href="bmrc-20231231.xsd#bmrc_FHLBSecuritiesBackedCreditProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:to="loc_bmrc_FHLBSecuritiesBackedCreditProgramMember_86cde4fe-28aa-49a5-b85b-d0e74c1e6ea9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalReserveBankTermFundingProgramMember_4de8169f-f905-467d-a8be-42ac1d38003b" xlink:href="bmrc-20231231.xsd#bmrc_FederalReserveBankTermFundingProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_a8b9e0a0-aaac-435a-931b-57c1059b4536" xlink:to="loc_bmrc_FederalReserveBankTermFundingProgramMember_4de8169f-f905-467d-a8be-42ac1d38003b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SecuritiesLoanedFairValueOfCollateral_a1018264-e864-4ad5-99dd-ca9661c4903b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SecuritiesLoanedFairValueOfCollateral"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_515b60d9-e2dd-4f86-8414-ac1373763bc3" xlink:to="loc_us-gaap_SecuritiesLoanedFairValueOfCollateral_a1018264-e864-4ad5-99dd-ca9661c4903b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofUnrealizedLossPositionsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesScheduleofUnrealizedLossPositionsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesScheduleofUnrealizedLossPositionsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_bcdf38ff-d947-4cb8-8e09-893f69976baf" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_bcdf38ff-d947-4cb8-8e09-893f69976baf" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_7e792e61-b156-4cfa-a074-d0f4c07ec558" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesTable_bcdf38ff-d947-4cb8-8e09-893f69976baf" xlink:to="loc_us-gaap_FinancialInstrumentAxis_7e792e61-b156-4cfa-a074-d0f4c07ec558" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7e792e61-b156-4cfa-a074-d0f4c07ec558_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_7e792e61-b156-4cfa-a074-d0f4c07ec558" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7e792e61-b156-4cfa-a074-d0f4c07ec558_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_7e792e61-b156-4cfa-a074-d0f4c07ec558" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_e1248fb1-6d27-476d-bb18-6e1cd0f9139a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_MortgageBackedSecuritiesIssuedByUSGovernmentSponsoredEnterprisesMember_e1248fb1-6d27-476d-bb18-6e1cd0f9139a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_c0b4d593-a0b0-4cfc-a3b3-13e4fc8c815a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_FederalHomeLoanMortgageCorporationCertificatesAndObligationsFHLMCMember_c0b4d593-a0b0-4cfc-a3b3-13e4fc8c815a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_16d4a1ce-8bc7-4dbb-8f70-6bfeb38c3918" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_FederalNationalMortgageAssociationCertificatesAndObligationsFNMAMember_16d4a1ce-8bc7-4dbb-8f70-6bfeb38c3918" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GovernmentNationalMortgageAssociationGnmaInsuredLoansMember_6c021600-7a52-4ec5-8f8c-a9b905b8a3db" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GovernmentNationalMortgageAssociationGnmaInsuredLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_GovernmentNationalMortgageAssociationGnmaInsuredLoansMember_6c021600-7a52-4ec5-8f8c-a9b905b8a3db" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_f99e3f06-1c0e-4136-b410-f25cb940bdfc" xlink:href="bmrc-20231231.xsd#bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_f99e3f06-1c0e-4136-b410-f25cb940bdfc" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_219d5f69-45d9-47e7-ac35-05477eaa5106" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_219d5f69-45d9-47e7-ac35-05477eaa5106" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_71fe9638-9093-4f31-aab1-12626a951303" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_71fe9638-9093-4f31-aab1-12626a951303" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_3cb6f86f-eeab-42a3-8cad-4adcb8c9b197" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_3cb6f86f-eeab-42a3-8cad-4adcb8c9b197" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_129290de-eafe-463a-a439-8094ed5f3a21" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_129290de-eafe-463a-a439-8094ed5f3a21" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_93a34e10-732b-48fd-ac7b-3ba877dd7863" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_4987f053-d60d-4cdd-a177-694c729ea353" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_93a34e10-732b-48fd-ac7b-3ba877dd7863" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract_7f56c88b-f403-421d-9823-2c025a63cc95" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract_7f56c88b-f403-421d-9823-2c025a63cc95" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_45697016-0307-4add-8c21-f3ffeb81ccae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract_7f56c88b-f403-421d-9823-2c025a63cc95" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_45697016-0307-4add-8c21-f3ffeb81ccae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_17a6ec0d-cd3c-44f7-8b88-c902ba1df0a2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract_7f56c88b-f403-421d-9823-2c025a63cc95" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_17a6ec0d-cd3c-44f7-8b88-c902ba1df0a2" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValue_95685955-c592-43d4-841b-7c2d76927343" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueAbstract_7f56c88b-f403-421d-9823-2c025a63cc95" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValue_95685955-c592-43d4-841b-7c2d76927343" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_714e66d2-0832-4751-827c-66be7cd8e6e5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_714e66d2-0832-4751-827c-66be7cd8e6e5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_a2ddaa50-5582-4dcc-98c0-6311d45d7331" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_714e66d2-0832-4751-827c-66be7cd8e6e5" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_a2ddaa50-5582-4dcc-98c0-6311d45d7331" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_521b4c71-5d4c-4d2d-8e52-3db3cf56c843" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_714e66d2-0832-4751-827c-66be7cd8e6e5" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_521b4c71-5d4c-4d2d-8e52-3db3cf56c843" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_4fb0d76d-f6ac-4f39-b07c-cf1b7ea7c295" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_714e66d2-0832-4751-827c-66be7cd8e6e5" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_4fb0d76d-f6ac-4f39-b07c-cf1b7ea7c295" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract_9236b03d-b25a-4092-9c32-3bada102e482" xlink:href="bmrc-20231231.xsd#bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract_9236b03d-b25a-4092-9c32-3bada102e482" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_849a71aa-2186-4fdf-843b-73af47ca413e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract_9236b03d-b25a-4092-9c32-3bada102e482" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_849a71aa-2186-4fdf-843b-73af47ca413e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_2fd37001-257e-46b9-b134-3b1c330c31be" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract_9236b03d-b25a-4092-9c32-3bada102e482" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_2fd37001-257e-46b9-b134-3b1c330c31be" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_32930efa-8c6a-4b58-9ccc-32a9cb3f7ec7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionFairValueAbstract_9236b03d-b25a-4092-9c32-3bada102e482" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_32930efa-8c6a-4b58-9ccc-32a9cb3f7ec7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_48f7334d-7d78-427b-891c-6b1fb8698588" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_48f7334d-7d78-427b-891c-6b1fb8698588" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_29c10c11-4c45-4cbc-bfa5-bcec19693819" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_48f7334d-7d78-427b-891c-6b1fb8698588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_29c10c11-4c45-4cbc-bfa5-bcec19693819" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_d93e1d27-f802-4738-8def-7591734cd3ed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_48f7334d-7d78-427b-891c-6b1fb8698588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_d93e1d27-f802-4738-8def-7591734cd3ed" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_000ed3c2-8317-4e26-91fa-267599ddb660" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_48f7334d-7d78-427b-891c-6b1fb8698588" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_000ed3c2-8317-4e26-91fa-267599ddb660" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract_5a3b5993-2c7c-4e75-b4f0-5ae47235df6c" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract_5a3b5993-2c7c-4e75-b4f0-5ae47235df6c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_8114df28-2b68-480f-95cb-91519ef23b30" xlink:href="bmrc-20231231.xsd#bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract_5a3b5993-2c7c-4e75-b4f0-5ae47235df6c" xlink:to="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_8114df28-2b68-480f-95cb-91519ef23b30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_267a9bea-7f00-433c-935a-3345583b58c5" xlink:href="bmrc-20231231.xsd#bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract_5a3b5993-2c7c-4e75-b4f0-5ae47235df6c" xlink:to="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_267a9bea-7f00-433c-935a-3345583b58c5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueTotal_cc97201b-c8d6-4bce-a7bf-2c918d4671d5" xlink:href="bmrc-20231231.xsd#bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueTotal"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionFairValueAbstract_5a3b5993-2c7c-4e75-b4f0-5ae47235df6c" xlink:to="loc_bmrc_AvailableForSaleSecuritiesAndHeldToMaturitySecuritiesContinuousUnrealizedLossPositionFairValueTotal_cc97201b-c8d6-4bce-a7bf-2c918d4671d5" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_c95102d3-bc31-4b0d-a626-8645cfeb4cbb" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfAvailableForSaleSecuritiesAndHeldToMaturitySecuritiesLineItems_7cd012c3-61bc-4dea-859e-52083133efc8" xlink:to="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_c95102d3-bc31-4b0d-a626-8645cfeb4cbb" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionLessthan12MonthsAccumulatedLoss_4bbb392e-a81f-40d2-8de8-200b756092a7" xlink:href="bmrc-20231231.xsd#bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionLessthan12MonthsAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_c95102d3-bc31-4b0d-a626-8645cfeb4cbb" xlink:to="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionLessthan12MonthsAccumulatedLoss_4bbb392e-a81f-40d2-8de8-200b756092a7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPosition12MonthsorLongerAccumulatedLoss_10d7d175-b6ef-4dee-bf39-5b07422c9eb4" xlink:href="bmrc-20231231.xsd#bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPosition12MonthsorLongerAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_c95102d3-bc31-4b0d-a626-8645cfeb4cbb" xlink:to="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPosition12MonthsorLongerAccumulatedLoss_10d7d175-b6ef-4dee-bf39-5b07422c9eb4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_dfde4f34-e1c1-42e8-b0f5-5d3c1b2434b6" xlink:href="bmrc-20231231.xsd#bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_MarketableSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_c95102d3-bc31-4b0d-a626-8645cfeb4cbb" xlink:to="loc_bmrc_AvailableforsaleSecuritiesandHeldtomaturitySecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_dfde4f34-e1c1-42e8-b0f5-5d3c1b2434b6" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/InvestmentSecuritiesNonMarketableSecuritiesIncludedinOtherAssetsNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#InvestmentSecuritiesNonMarketableSecuritiesIncludedinOtherAssetsNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/InvestmentSecuritiesNonMarketableSecuritiesIncludedinOtherAssetsNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfEquityMethodInvestmentsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfEquityMethodInvestmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationAxis_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:to="loc_us-gaap_BalanceSheetLocationAxis_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BalanceSheetLocationDomain_629ef63e-3f2a-4da0-8647-ae883628f54d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BalanceSheetLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BalanceSheetLocationAxis_f88c00bc-6d5f-4eea-8cac-d16b6c0c4b71" xlink:to="loc_us-gaap_BalanceSheetLocationDomain_629ef63e-3f2a-4da0-8647-ae883628f54d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssetsMember_b5a965f5-b21c-45fb-aaf5-2c9f7ad3f480" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BalanceSheetLocationDomain_629ef63e-3f2a-4da0-8647-ae883628f54d" xlink:to="loc_us-gaap_OtherAssetsMember_b5a965f5-b21c-45fb-aaf5-2c9f7ad3f480" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_1ffc3252-0ed9-4881-a428-0256d1bcd71c" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:to="loc_srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_1ffc3252-0ed9-4881-a428-0256d1bcd71c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_EquityMethodInvesteeNameDomain_1ffc3252-0ed9-4881-a428-0256d1bcd71c_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_EquityMethodInvesteeNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_1ffc3252-0ed9-4881-a428-0256d1bcd71c" xlink:to="loc_srt_EquityMethodInvesteeNameDomain_1ffc3252-0ed9-4881-a428-0256d1bcd71c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_EquityMethodInvesteeNameDomain_4c102f33-0274-40b6-a30a-fc06ef5cd04b" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_EquityMethodInvesteeNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ScheduleOfEquityMethodInvestmentEquityMethodInvesteeNameAxis_1ffc3252-0ed9-4881-a428-0256d1bcd71c" xlink:to="loc_srt_EquityMethodInvesteeNameDomain_4c102f33-0274-40b6-a30a-fc06ef5cd04b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_VisaInc.ClassBCommonStockMember_d4033af7-7882-4222-9462-bf8d559a415e" xlink:href="bmrc-20231231.xsd#bmrc_VisaInc.ClassBCommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_EquityMethodInvesteeNameDomain_4c102f33-0274-40b6-a30a-fc06ef5cd04b" xlink:to="loc_bmrc_VisaInc.ClassBCommonStockMember_d4033af7-7882-4222-9462-bf8d559a415e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeAxis_4ba28bdf-6b54-40d0-b468-4113b82b858a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:to="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeAxis_4ba28bdf-6b54-40d0-b468-4113b82b858a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain_4ba28bdf-6b54-40d0-b468-4113b82b858a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeAxis_4ba28bdf-6b54-40d0-b468-4113b82b858a" xlink:to="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain_4ba28bdf-6b54-40d0-b468-4113b82b858a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain_3575ea71-2c36-4fb3-a331-3a75062b35a8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeAxis_4ba28bdf-6b54-40d0-b468-4113b82b858a" xlink:to="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain_3575ea71-2c36-4fb3-a331-3a75062b35a8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_VisaInc.ClassBCommonStockMember_157e7d6f-336a-4307-93a1-ddeba84acdda" xlink:href="bmrc-20231231.xsd#bmrc_VisaInc.ClassBCommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityMethodInvestmentNonconsolidatedInvesteeDomain_3575ea71-2c36-4fb3-a331-3a75062b35a8" xlink:to="loc_bmrc_VisaInc.ClassBCommonStockMember_157e7d6f-336a-4307-93a1-ddeba84acdda" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsTable_db1540a0-795a-4f53-bc45-78f4aef66eab" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_56405054-3e7a-4a93-8c71-0b33a678d056" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_e227af88-38b3-4c7f-a5a4-1d8b75c68e0b" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_56405054-3e7a-4a93-8c71-0b33a678d056" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventMember_2cd50055-bdc3-4df5-9d8a-d5bd9fba2434" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SubsequentEventTypeDomain_56405054-3e7a-4a93-8c71-0b33a678d056" xlink:to="loc_us-gaap_SubsequentEventMember_2cd50055-bdc3-4df5-9d8a-d5bd9fba2434" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalHomeLoanBankStockParValue_7a8b8d76-c853-40f8-9c75-a2e48f2de8be" xlink:href="bmrc-20231231.xsd#bmrc_FederalHomeLoanBankStockParValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_bmrc_FederalHomeLoanBankStockParValue_7a8b8d76-c853-40f8-9c75-a2e48f2de8be" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanBankStock_d3451254-ee31-4181-8918-abdcc6183ca4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanBankStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_FederalHomeLoanBankStock_d3451254-ee31-4181-8918-abdcc6183ca4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalHomeLoanBankDividendRatePercentage_a72343b7-cb3d-4f94-a921-57cc1526ae75" xlink:href="bmrc-20231231.xsd#bmrc_FederalHomeLoanBankDividendRatePercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_bmrc_FederalHomeLoanBankDividendRatePercentage_a72343b7-cb3d-4f94-a921-57cc1526ae75" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentOwnedBalanceShares_f0272ac2-8156-4787-8a1b-23c463f354a5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentOwnedBalanceShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_InvestmentOwnedBalanceShares_f0272ac2-8156-4787-8a1b-23c463f354a5" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySecuritiesFvNiCost_1f441974-d4ef-4807-b641-f5626eacccad" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquitySecuritiesFvNiCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_EquitySecuritiesFvNiCost_1f441974-d4ef-4807-b641-f5626eacccad" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquitySecuritiesFvNiGainLoss_62a781db-610d-4291-859c-fd298ef343be" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquitySecuritiesFvNiGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_EquitySecuritiesFvNiGainLoss_62a781db-610d-4291-859c-fd298ef343be" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestments_d91670f7-9be7-41d6-aea4-403332226c8c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestments_d91670f7-9be7-41d6-aea4-403332226c8c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsTaxCredits_b1e8d945-eb66-48dc-9368-aae6ae632e2b" xlink:href="bmrc-20231231.xsd#bmrc_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsTaxCredits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_bmrc_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsTaxCredits_b1e8d945-eb66-48dc-9368-aae6ae632e2b" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsAmortization_f2a4680e-bc06-46d9-bac1-4486c1c674f0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_us-gaap_AmortizationMethodQualifiedAffordableHousingProjectInvestmentsAmortization_f2a4680e-bc06-46d9-bac1-4486c1c674f0" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AffordableHousingProgramUnfundedCommitments_25900893-49e6-4966-bacc-da89aae93753" xlink:href="bmrc-20231231.xsd#bmrc_AffordableHousingProgramUnfundedCommitments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_bmrc_AffordableHousingProgramUnfundedCommitments_25900893-49e6-4966-bacc-da89aae93753" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AffordableHousingCreditsInvestmentImpairmentLoss_6d858081-0769-44a4-b102-356af37a7c35" xlink:href="bmrc-20231231.xsd#bmrc_AffordableHousingCreditsInvestmentImpairmentLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfEquityMethodInvestmentsLineItems_c0e2d4cd-efb5-4732-999b-4fc9bee22761" xlink:to="loc_bmrc_AffordableHousingCreditsInvestmentImpairmentLoss_6d858081-0769-44a4-b102-356af37a7c35" xlink:type="arc" order="10"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyClassDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyClassDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyClassDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_c2dd6869-d1c6-4be9-b2cc-cf462c071475" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_c2dd6869-d1c6-4be9-b2cc-cf462c071475" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_36a50b79-e59c-4cab-97c9-192a8352c5ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_c2dd6869-d1c6-4be9-b2cc-cf462c071475" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_36a50b79-e59c-4cab-97c9-192a8352c5ce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_36a50b79-e59c-4cab-97c9-192a8352c5ce_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_36a50b79-e59c-4cab-97c9-192a8352c5ce" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_36a50b79-e59c-4cab-97c9-192a8352c5ce_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_36a50b79-e59c-4cab-97c9-192a8352c5ce" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_62c07d1a-1030-4ca0-b483-77c8e99179e9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_62c07d1a-1030-4ca0-b483-77c8e99179e9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_a7ca19b7-94bc-4c0f-bec9-954f247ce776" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_a7ca19b7-94bc-4c0f-bec9-954f247ce776" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_688250aa-a98c-4635-979f-50e223f15780" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_688250aa-a98c-4635-979f-50e223f15780" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_19e46f22-c35e-4f40-94cd-172b4edf6c5f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_4a83817a-361a-4a60-9577-d4d6210492ee" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_19e46f22-c35e-4f40-94cd-172b4edf6c5f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_bbf07256-98d1-45dc-837f-a01ea1207cfa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_c2dd6869-d1c6-4be9-b2cc-cf462c071475" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_bbf07256-98d1-45dc-837f-a01ea1207cfa" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bbf07256-98d1-45dc-837f-a01ea1207cfa_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_bbf07256-98d1-45dc-837f-a01ea1207cfa" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bbf07256-98d1-45dc-837f-a01ea1207cfa_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_bbf07256-98d1-45dc-837f-a01ea1207cfa" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_a6ffa1c7-2a0a-4276-a04b-01e02e89d7ff" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_bmrc_CommercialAndIndustrialMember_a6ffa1c7-2a0a-4276-a04b-01e02e89d7ff" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_f4aa4491-003f-4213-9a36-0d04d5ecd92e" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_f4aa4491-003f-4213-9a36-0d04d5ecd92e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_dcc7bee2-bc99-431c-af4b-1254f6ece317" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_dcc7bee2-bc99-431c-af4b-1254f6ece317" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_71801fe9-b53b-4762-97b3-ad74d8f23636" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_us-gaap_ConstructionLoansMember_71801fe9-b53b-4762-97b3-ad74d8f23636" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_9ba479dd-05ef-4d47-a4b3-4e21ad1b7649" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_us-gaap_HomeEquityLoanMember_9ba479dd-05ef-4d47-a4b3-4e21ad1b7649" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_42da43b4-5540-41fc-a0f7-f8aac05e4d86" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_bmrc_OtherResidentialLoanMember_42da43b4-5540-41fc-a0f7-f8aac05e4d86" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_7e323e25-25af-4333-811e-03fd89c1a497" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_26f76c4e-66c9-4aba-9944-bbde7b402d8a" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_7e323e25-25af-4333-811e-03fd89c1a497" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_39af7107-a7de-4011-b689-bdc656cf6c62" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_39af7107-a7de-4011-b689-bdc656cf6c62" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_3db39b4f-64ff-46ee-ad7b-465057588107" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_3db39b4f-64ff-46ee-ad7b-465057588107" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAfterAllowanceForCreditLoss_8775667d-cdde-4229-9f7e-e6cce23f6ef8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestAfterAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAfterAllowanceForCreditLoss_8775667d-cdde-4229-9f7e-e6cce23f6ef8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinancingReceivableNetDeferredLoanOriginationCostsFees_b085e08a-f97c-4206-947f-48395974a946" xlink:href="bmrc-20231231.xsd#bmrc_FinancingReceivableNetDeferredLoanOriginationCostsFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_bmrc_FinancingReceivableNetDeferredLoanOriginationCostsFees_b085e08a-f97c-4206-947f-48395974a946" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CertainLoansAcquiredInTransferWithoutEvidenceOfDeterioratedCreditUnrecognizedPurchaseDiscounts_93159de3-dc9d-4f83-9fed-5a2c394c63f0" xlink:href="bmrc-20231231.xsd#bmrc_CertainLoansAcquiredInTransferWithoutEvidenceOfDeterioratedCreditUnrecognizedPurchaseDiscounts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_bmrc_CertainLoansAcquiredInTransferWithoutEvidenceOfDeterioratedCreditUnrecognizedPurchaseDiscounts_93159de3-dc9d-4f83-9fed-5a2c394c63f0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLoss_3c0f6fe6-2e18-4297-ada9-06ae4acacce2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLoss_3c0f6fe6-2e18-4297-ada9-06ae4acacce2" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList_889178cc-eba1-48b3-a103-9050f5a7f926" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_20c45e89-ef3c-4782-80b2-960b27432305" xlink:to="loc_us-gaap_FinancingReceivableAccruedInterestAfterAllowanceForCreditLossStatementOfFinancialPositionExtensibleList_889178cc-eba1-48b3-a103-9050f5a7f926" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansConcentrationsofCreditNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansConcentrationsofCreditNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansConcentrationsofCreditNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_4ec43aed-2fc1-4ad3-bc38-75000457260a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_86cca496-4771-4aed-9551-762914f3c07e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_4ec43aed-2fc1-4ad3-bc38-75000457260a" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_86cca496-4771-4aed-9551-762914f3c07e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e4b55026-ba84-41f3-80f1-5f5e296c0ddd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_86cca496-4771-4aed-9551-762914f3c07e" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e4b55026-ba84-41f3-80f1-5f5e296c0ddd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_e4b55026-ba84-41f3-80f1-5f5e296c0ddd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e4b55026-ba84-41f3-80f1-5f5e296c0ddd" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_e4b55026-ba84-41f3-80f1-5f5e296c0ddd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_9e8bd2db-d699-4688-ab80-fb4cfdcf7f3f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e4b55026-ba84-41f3-80f1-5f5e296c0ddd" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_9e8bd2db-d699-4688-ab80-fb4cfdcf7f3f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RealEstateLoanMember_a6181f4d-b70a-4eee-b8bd-db678578161c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RealEstateLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_9e8bd2db-d699-4688-ab80-fb4cfdcf7f3f" xlink:to="loc_us-gaap_RealEstateLoanMember_a6181f4d-b70a-4eee-b8bd-db678578161c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_b9c0d3b1-b612-4ed8-bcfa-108763138020" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_86cca496-4771-4aed-9551-762914f3c07e" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_b9c0d3b1-b612-4ed8-bcfa-108763138020" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_b9c0d3b1-b612-4ed8-bcfa-108763138020_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_b9c0d3b1-b612-4ed8-bcfa-108763138020" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_b9c0d3b1-b612-4ed8-bcfa-108763138020_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6c62beeb-6d87-4a0f-a8ee-83a49f36508c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_b9c0d3b1-b612-4ed8-bcfa-108763138020" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6c62beeb-6d87-4a0f-a8ee-83a49f36508c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_1901b41e-c697-476e-b645-202fac2f5c0c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6c62beeb-6d87-4a0f-a8ee-83a49f36508c" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_1901b41e-c697-476e-b645-202fac2f5c0c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_01205e72-17a7-4db6-9096-96f482bc001f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6c62beeb-6d87-4a0f-a8ee-83a49f36508c" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_01205e72-17a7-4db6-9096-96f482bc001f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LoansAndLeasesReceivableRatioOfClassToAllLoans_51b084f5-d434-4c8c-ba61-c42129875a57" xlink:href="bmrc-20231231.xsd#bmrc_LoansAndLeasesReceivableRatioOfClassToAllLoans"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_4ec43aed-2fc1-4ad3-bc38-75000457260a" xlink:to="loc_bmrc_LoansAndLeasesReceivableRatioOfClassToAllLoans_51b084f5-d434-4c8c-ba61-c42129875a57" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_19c2e4bb-a91f-48c3-9c7b-ab329c85d55b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_4ec43aed-2fc1-4ad3-bc38-75000457260a" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_19c2e4bb-a91f-48c3-9c7b-ab329c85d55b" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyRiskGradeandOriginationYearDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyRiskGradeandOriginationYearDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofLoansbyRiskGradeandOriginationYearDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable_c7c26e74-76f1-4db6-b689-0e77e141b561" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable_c7c26e74-76f1-4db6-b689-0e77e141b561" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_fd40379f-f414-4afd-91bd-2a87d470e7fb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable_c7c26e74-76f1-4db6-b689-0e77e141b561" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_fd40379f-f414-4afd-91bd-2a87d470e7fb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_fd40379f-f414-4afd-91bd-2a87d470e7fb_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_fd40379f-f414-4afd-91bd-2a87d470e7fb" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_fd40379f-f414-4afd-91bd-2a87d470e7fb_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_fd40379f-f414-4afd-91bd-2a87d470e7fb" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_11b6e507-5935-4126-bfb4-21a3931b73c8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_11b6e507-5935-4126-bfb4-21a3931b73c8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_dbae7607-1eec-4ebc-ac1b-626c4e2fa197" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_dbae7607-1eec-4ebc-ac1b-626c4e2fa197" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_19afa209-15ff-49ae-a82b-679a344e9322" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_19afa209-15ff-49ae-a82b-679a344e9322" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_8fa3ee48-dfea-4018-93ed-1c0bd8f8bdfe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_f693a3e8-61f1-4075-8949-1393297f8287" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_8fa3ee48-dfea-4018-93ed-1c0bd8f8bdfe" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_22193587-ae02-47e9-b4ad-ec4925ec7449" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable_c7c26e74-76f1-4db6-b689-0e77e141b561" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_22193587-ae02-47e9-b4ad-ec4925ec7449" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_22193587-ae02-47e9-b4ad-ec4925ec7449_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_22193587-ae02-47e9-b4ad-ec4925ec7449" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_22193587-ae02-47e9-b4ad-ec4925ec7449_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_22193587-ae02-47e9-b4ad-ec4925ec7449" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_0888474f-9fa7-4831-9a40-9eec001ec351" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_bmrc_CommercialAndIndustrialMember_0888474f-9fa7-4831-9a40-9eec001ec351" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_52a3d2a4-4f72-4b99-8ce0-34ea81c157d1" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_52a3d2a4-4f72-4b99-8ce0-34ea81c157d1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_a93e6623-1222-4f54-ba85-f56c869e77b9" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_a93e6623-1222-4f54-ba85-f56c869e77b9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_187e010a-9d9c-49db-a216-17915236b28f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_us-gaap_ConstructionLoansMember_187e010a-9d9c-49db-a216-17915236b28f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_a7808825-d3db-4f06-970b-1c106cf849fc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_us-gaap_HomeEquityLoanMember_a7808825-d3db-4f06-970b-1c106cf849fc" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_cbd0612b-987a-4248-953d-539388d99b77" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_bmrc_OtherResidentialLoanMember_cbd0612b-987a-4248-953d-539388d99b77" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_94a6ec4e-4deb-4741-aa15-30c4f28d700b" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_de78babf-b9da-42f0-8c85-b3210dee238a" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_94a6ec4e-4deb-4741-aa15-30c4f28d700b" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InternalCreditAssessmentAxis_6bf029e9-2af0-488e-a1d9-cbfbf2b528da" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InternalCreditAssessmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableRecordedInvestmentCreditQualityIndicatorTable_c7c26e74-76f1-4db6-b689-0e77e141b561" xlink:to="loc_us-gaap_InternalCreditAssessmentAxis_6bf029e9-2af0-488e-a1d9-cbfbf2b528da" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InternalCreditAssessmentDomain_6bf029e9-2af0-488e-a1d9-cbfbf2b528da_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InternalCreditAssessmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_InternalCreditAssessmentAxis_6bf029e9-2af0-488e-a1d9-cbfbf2b528da" xlink:to="loc_us-gaap_InternalCreditAssessmentDomain_6bf029e9-2af0-488e-a1d9-cbfbf2b528da_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InternalCreditAssessmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_InternalCreditAssessmentAxis_6bf029e9-2af0-488e-a1d9-cbfbf2b528da" xlink:to="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PassMember_76f7118c-833c-4d6a-99d3-1ce15ff92168" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PassMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:to="loc_us-gaap_PassMember_76f7118c-833c-4d6a-99d3-1ce15ff92168" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SpecialMentionMember_b4504f3c-eeac-4847-bd74-9a692c3b564f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SpecialMentionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:to="loc_us-gaap_SpecialMentionMember_b4504f3c-eeac-4847-bd74-9a692c3b564f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubstandardMember_b824c6b6-9920-4bbb-9bab-ed67ba4ce580" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubstandardMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:to="loc_us-gaap_SubstandardMember_b824c6b6-9920-4bbb-9bab-ed67ba4ce580" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DoubtfulMember_4ebd0623-abb4-489f-82b0-1595b7d034be" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DoubtfulMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InternalCreditAssessmentDomain_ded5ff5a-0cba-40a1-a6b2-ad8a24a8f330" xlink:to="loc_us-gaap_DoubtfulMember_4ebd0623-abb4-489f-82b0-1595b7d034be" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYear_1bf141a0-c25f-460d-ab67-e0ae71b50212" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYear_1bf141a0-c25f-460d-ab67-e0ae71b50212" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYear_5efca039-3fd8-4a3f-9eef-2c90c3b30296" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYear_5efca039-3fd8-4a3f-9eef-2c90c3b30296" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYear_7b903e17-ca5b-4552-a3bc-f0e26f53f187" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYear_7b903e17-ca5b-4552-a3bc-f0e26f53f187" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYear_baba5168-e499-4fac-890a-053fa48fe73e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYear_baba5168-e499-4fac-890a-053fa48fe73e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYear_44ae9e86-e52b-4ab4-90fe-656c7574f58a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYear_44ae9e86-e52b-4ab4-90fe-656c7574f58a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYear_ee83e80f-6af9-46c9-8c3f-957ad0a0f80b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYear"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYear_ee83e80f-6af9-46c9-8c3f-957ad0a0f80b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestRevolving_02c97b7e-f6c2-496b-8c85-a840ddca0e1b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestRevolving"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestRevolving_02c97b7e-f6c2-496b-8c85-a840ddca0e1b" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_64aad8cc-42e1-4f67-a81c-468bcbcdb7ed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_64aad8cc-42e1-4f67-a81c-468bcbcdb7ed" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYearWriteoff_2f92344b-5d1c-4b01-96c0-4a03ffa490ec" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearOneOriginatedCurrentFiscalYearWriteoff_2f92344b-5d1c-4b01-96c0-4a03ffa490ec" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYearWriteoff_69120d88-9b9a-4350-ba17-6657433041a9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearTwoOriginatedFiscalYearBeforeCurrentFiscalYearWriteoff_69120d88-9b9a-4350-ba17-6657433041a9" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYearWriteoff_676e3d3b-bbe2-496c-9a4e-51b753d51034" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearThreeOriginatedTwoYearsBeforeCurrentFiscalYearWriteoff_676e3d3b-bbe2-496c-9a4e-51b753d51034" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYearWriteoff_ca0e22ef-4d03-476d-8bf8-4c573c9eefa8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFourOriginatedThreeYearsBeforeCurrentFiscalYearWriteoff_ca0e22ef-4d03-476d-8bf8-4c573c9eefa8" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYearWriteoff_ee183613-d124-4630-b63b-43b79ed0a402" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestYearFiveOriginatedFourYearsBeforeCurrentFiscalYearWriteoff_ee183613-d124-4630-b63b-43b79ed0a402" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYearWriteoff_69f80f23-38f0-485c-8a9f-70d8700bdbb9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYearWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestOriginatedMoreThanFiveYearsBeforeCurrentFiscalYearWriteoff_69f80f23-38f0-485c-8a9f-70d8700bdbb9" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestRevolvingWriteoff_d766286e-73e0-410f-9fa6-3a41029ef0a2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestRevolvingWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestRevolvingWriteoff_d766286e-73e0-410f-9fa6-3a41029ef0a2" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff_3c84a150-90ea-4f89-88a7-56b233d6a167" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentLineItems_d2653b66-bba1-4ff7-9caa-ce7c158aac42" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff_3c84a150-90ea-4f89-88a7-56b233d6a167" xlink:type="arc" order="15"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansLoansOutstandingandAgingAnalysisDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansLoansOutstandingandAgingAnalysisDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansLoansOutstandingandAgingAnalysisDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccountsNotesAndLoansReceivableLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_c97840ac-665e-4285-a046-f2f0c3b5be98" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_c97840ac-665e-4285-a046-f2f0c3b5be98" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c97840ac-665e-4285-a046-f2f0c3b5be98_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_c97840ac-665e-4285-a046-f2f0c3b5be98" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c97840ac-665e-4285-a046-f2f0c3b5be98_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_c97840ac-665e-4285-a046-f2f0c3b5be98" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_1ac624f2-be7d-44f6-8b53-20cf40ead25f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_1ac624f2-be7d-44f6-8b53-20cf40ead25f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_2da3c34a-2b9c-4861-8e28-69c0be0c690d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_2da3c34a-2b9c-4861-8e28-69c0be0c690d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_94aeb942-bc52-41a7-b53a-56f2bd16c72e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_94aeb942-bc52-41a7-b53a-56f2bd16c72e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_afe0a7df-255c-433c-8f5c-619e90a9300d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_81f22549-f619-4fcb-beec-9f2a02ad686d" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_afe0a7df-255c-433c-8f5c-619e90a9300d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_fe310e80-95b2-483d-a3f5-f55b2252b23b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_fe310e80-95b2-483d-a3f5-f55b2252b23b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_fe310e80-95b2-483d-a3f5-f55b2252b23b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_fe310e80-95b2-483d-a3f5-f55b2252b23b" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_fe310e80-95b2-483d-a3f5-f55b2252b23b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_fe310e80-95b2-483d-a3f5-f55b2252b23b" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_1b0f8a20-5d9f-41c5-9c25-3b413f2ca1cd" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_bmrc_CommercialAndIndustrialMember_1b0f8a20-5d9f-41c5-9c25-3b413f2ca1cd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_f7251e74-b59a-43ad-b3fb-4d3b9971199e" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_f7251e74-b59a-43ad-b3fb-4d3b9971199e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_be9ef57a-b757-4845-95db-c3fed489f383" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_be9ef57a-b757-4845-95db-c3fed489f383" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_9e30725c-fd6f-4bee-bdcc-e13bffdeaeec" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_us-gaap_ConstructionLoansMember_9e30725c-fd6f-4bee-bdcc-e13bffdeaeec" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_d1868f13-00e7-4c03-a379-e26eda251a56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_us-gaap_HomeEquityLoanMember_d1868f13-00e7-4c03-a379-e26eda251a56" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_8d1ef5af-1d51-40d6-a091-e8a6798b644f" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_bmrc_OtherResidentialLoanMember_8d1ef5af-1d51-40d6-a091-e8a6798b644f" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_7f78945d-ef60-4755-8eed-6a1d34301e48" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_bc9ade78-9a90-4483-a135-f986817a5db0" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_7f78945d-ef60-4755-8eed-6a1d34301e48" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_db294df9-8455-4221-b0c8-776cdd6903c3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_db294df9-8455-4221-b0c8-776cdd6903c3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_db294df9-8455-4221-b0c8-776cdd6903c3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_db294df9-8455-4221-b0c8-776cdd6903c3" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_db294df9-8455-4221-b0c8-776cdd6903c3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_c5e907be-aacd-4d5a-a5a6-0ef45b349c77" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_db294df9-8455-4221-b0c8-776cdd6903c3" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_c5e907be-aacd-4d5a-a5a6-0ef45b349c77" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialAssetPastDueMember_f9195ab8-510e-4fc1-86e9-9f2f416057c0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialAssetPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_c5e907be-aacd-4d5a-a5a6-0ef45b349c77" xlink:to="loc_us-gaap_FinancialAssetPastDueMember_f9195ab8-510e-4fc1-86e9-9f2f416057c0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivables30To59DaysPastDueMember_3b62c3b3-6353-438e-bc2d-83ddeb2e3ec2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivables30To59DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialAssetPastDueMember_f9195ab8-510e-4fc1-86e9-9f2f416057c0" xlink:to="loc_us-gaap_FinancingReceivables30To59DaysPastDueMember_3b62c3b3-6353-438e-bc2d-83ddeb2e3ec2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivables60To89DaysPastDueMember_dc607de8-9eb2-4b73-ac23-0f8520247718" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivables60To89DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialAssetPastDueMember_f9195ab8-510e-4fc1-86e9-9f2f416057c0" xlink:to="loc_us-gaap_FinancingReceivables60To89DaysPastDueMember_dc607de8-9eb2-4b73-ac23-0f8520247718" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember_e3511af0-ef28-4574-bf09-0a83387e1a1d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialAssetPastDueMember_f9195ab8-510e-4fc1-86e9-9f2f416057c0" xlink:to="loc_us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember_e3511af0-ef28-4574-bf09-0a83387e1a1d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialAssetNotPastDueMember_5073cfab-0939-44e4-8181-5ffd346fcd09" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialAssetNotPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_c5e907be-aacd-4d5a-a5a6-0ef45b349c77" xlink:to="loc_us-gaap_FinancialAssetNotPastDueMember_5073cfab-0939-44e4-8181-5ffd346fcd09" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditLossStatusAxis_2d55b571-3b34-48a9-a3e8-00dad1e0fece" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditLossStatusAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_7696a5df-fb9c-461a-ae73-51183f5849ab" xlink:to="loc_us-gaap_CreditLossStatusAxis_2d55b571-3b34-48a9-a3e8-00dad1e0fece" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditLossStatusDomain_2d55b571-3b34-48a9-a3e8-00dad1e0fece_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditLossStatusDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditLossStatusAxis_2d55b571-3b34-48a9-a3e8-00dad1e0fece" xlink:to="loc_us-gaap_CreditLossStatusDomain_2d55b571-3b34-48a9-a3e8-00dad1e0fece_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditLossStatusDomain_fad71e07-7f51-42a8-ada3-0bb0c27edf6e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditLossStatusDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditLossStatusAxis_2d55b571-3b34-48a9-a3e8-00dad1e0fece" xlink:to="loc_us-gaap_CreditLossStatusDomain_fad71e07-7f51-42a8-ada3-0bb0c27edf6e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialAssetOtherThanFinancialAssetAcquiredWithCreditDeteriorationMember_bcd064cd-0ba4-436a-bb66-33484b85724b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialAssetOtherThanFinancialAssetAcquiredWithCreditDeteriorationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditLossStatusDomain_fad71e07-7f51-42a8-ada3-0bb0c27edf6e" xlink:to="loc_us-gaap_FinancialAssetOtherThanFinancialAssetAcquiredWithCreditDeteriorationMember_bcd064cd-0ba4-436a-bb66-33484b85724b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_7f8104a5-52f8-4e63-92ee-94f4411603c8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestBeforeAllowanceForCreditLoss_7f8104a5-52f8-4e63-92ee-94f4411603c8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual_9ecf181a-952e-4b33-98b5-fd42c2d83d18" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual_9ecf181a-952e-4b33-98b5-fd42c2d83d18" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrualNoAllowance_9c505a18-1ad6-4c4c-bdc0-934cb0be81d4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrualNoAllowance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrualNoAllowance_9c505a18-1ad6-4c4c-bdc0-934cb0be81d4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinancingReceivable90DaysOrMorePastDueStillAccruingNumberOfLoans_07fe7a06-ad99-46c6-894e-9ae20e489d8e" xlink:href="bmrc-20231231.xsd#bmrc_FinancingReceivable90DaysOrMorePastDueStillAccruingNumberOfLoans"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_bmrc_FinancingReceivable90DaysOrMorePastDueStillAccruingNumberOfLoans_07fe7a06-ad99-46c6-894e-9ae20e489d8e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinancingReceivableNonaccrualEarningInterestOnCashBasis_21fdd2a9-0e46-4bc7-aaf0-40639c8aa99a" xlink:href="bmrc-20231231.xsd#bmrc_FinancingReceivableNonaccrualEarningInterestOnCashBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_bmrc_FinancingReceivableNonaccrualEarningInterestOnCashBasis_21fdd2a9-0e46-4bc7-aaf0-40639c8aa99a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableNonaccrualInterestIncome_2992cf70-9508-455f-8e79-3661c2cf3826" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableNonaccrualInterestIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_FinancingReceivableNonaccrualInterestIncome_2992cf70-9508-455f-8e79-3661c2cf3826" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAccruedInterestWriteoff_4f3b335c-c07d-4b6e-8a97-1c14f29e8da9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAccruedInterestWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_7dead58e-8338-4d68-9276-90cf1c41def7" xlink:to="loc_us-gaap_FinancingReceivableAccruedInterestWriteoff_4f3b335c-c07d-4b6e-8a97-1c14f29e8da9" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofCollateralDependentNonAccrualLoansDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofCollateralDependentNonAccrualLoansDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofCollateralDependentNonAccrualLoansDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccountsNotesAndLoansReceivableLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_29b6bf36-3daf-46a7-9a18-3de03910d570" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:to="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_29b6bf36-3daf-46a7-9a18-3de03910d570" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_892cc1fa-94d2-4329-a6fd-17f5d17243cf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_29b6bf36-3daf-46a7-9a18-3de03910d570" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_892cc1fa-94d2-4329-a6fd-17f5d17243cf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_892cc1fa-94d2-4329-a6fd-17f5d17243cf_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_892cc1fa-94d2-4329-a6fd-17f5d17243cf" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_892cc1fa-94d2-4329-a6fd-17f5d17243cf_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c205b469-9bde-44df-8e9c-1779fea6fa1c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_892cc1fa-94d2-4329-a6fd-17f5d17243cf" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c205b469-9bde-44df-8e9c-1779fea6fa1c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_7656cad6-1f16-464d-9ea9-7b54e3c7a4bf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c205b469-9bde-44df-8e9c-1779fea6fa1c" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_7656cad6-1f16-464d-9ea9-7b54e3c7a4bf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_b6ec7368-4f84-45a0-9656-6661e0a725d1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c205b469-9bde-44df-8e9c-1779fea6fa1c" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_b6ec7368-4f84-45a0-9656-6661e0a725d1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_4dcbd673-2905-4db6-a55c-341c4f2e032f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_c205b469-9bde-44df-8e9c-1779fea6fa1c" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_4dcbd673-2905-4db6-a55c-341c4f2e032f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e806e26c-0632-49e4-9558-dbb9dc126f75" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_29b6bf36-3daf-46a7-9a18-3de03910d570" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e806e26c-0632-49e4-9558-dbb9dc126f75" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_e806e26c-0632-49e4-9558-dbb9dc126f75_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e806e26c-0632-49e4-9558-dbb9dc126f75" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_e806e26c-0632-49e4-9558-dbb9dc126f75_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_e806e26c-0632-49e4-9558-dbb9dc126f75" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_c42d6225-54da-4485-8774-515f7d8e4b3d" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_bmrc_CommercialAndIndustrialMember_c42d6225-54da-4485-8774-515f7d8e4b3d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_488dde79-d9ef-49c7-9b49-3b158159415d" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_488dde79-d9ef-49c7-9b49-3b158159415d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_857a7ced-460e-44c5-b0de-126cad01c2b4" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_857a7ced-460e-44c5-b0de-126cad01c2b4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_c50ba68b-0b9c-4032-9cd7-7793b2733b10" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_us-gaap_HomeEquityLoanMember_c50ba68b-0b9c-4032-9cd7-7793b2733b10" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_c399834c-c116-4d62-85d2-f2111acc056a" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_c399834c-c116-4d62-85d2-f2111acc056a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_1c103d3a-c267-4050-97e0-d4d10ce301fb" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_91da733c-32b7-4a82-a5df-3150ec39d527" xlink:to="loc_bmrc_OtherResidentialLoanMember_1c103d3a-c267-4050-97e0-d4d10ce301fb" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CollateralAxis_95accaba-dd0e-40fe-bf45-24991a52caae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CollateralAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAccountsNotesLoansAndFinancingReceivableTable_29b6bf36-3daf-46a7-9a18-3de03910d570" xlink:to="loc_us-gaap_CollateralAxis_95accaba-dd0e-40fe-bf45-24991a52caae" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CollateralDomain_95accaba-dd0e-40fe-bf45-24991a52caae_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CollateralDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CollateralAxis_95accaba-dd0e-40fe-bf45-24991a52caae" xlink:to="loc_us-gaap_CollateralDomain_95accaba-dd0e-40fe-bf45-24991a52caae_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CollateralDomain_4e9857e4-5b5e-4ec2-9069-59b1f87300f7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CollateralDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CollateralAxis_95accaba-dd0e-40fe-bf45-24991a52caae" xlink:to="loc_us-gaap_CollateralDomain_4e9857e4-5b5e-4ec2-9069-59b1f87300f7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CollateralPledgedMember_8725a7fc-de38-4adc-98df-b31bfface4f3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CollateralPledgedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CollateralDomain_4e9857e4-5b5e-4ec2-9069-59b1f87300f7" xlink:to="loc_us-gaap_CollateralPledgedMember_8725a7fc-de38-4adc-98df-b31bfface4f3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstateMember_f91e4792-5cd8-4261-8b91-c1db4735727f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CollateralPledgedMember_8725a7fc-de38-4adc-98df-b31bfface4f3" xlink:to="loc_us-gaap_CommercialRealEstateMember_f91e4792-5cd8-4261-8b91-c1db4735727f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialRealEstateMember_5f94078b-ae6a-4fe3-92e7-eb4fee521a82" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialRealEstateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CollateralPledgedMember_8725a7fc-de38-4adc-98df-b31bfface4f3" xlink:to="loc_us-gaap_ResidentialRealEstateMember_5f94078b-ae6a-4fe3-92e7-eb4fee521a82" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherCollateralHeldMember_8ef228a8-938c-44e7-9c79-14f4586d5395" xlink:href="bmrc-20231231.xsd#bmrc_OtherCollateralHeldMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CollateralPledgedMember_8725a7fc-de38-4adc-98df-b31bfface4f3" xlink:to="loc_bmrc_OtherCollateralHeldMember_8ef228a8-938c-44e7-9c79-14f4586d5395" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual_94b2f5ae-dfb0-45f5-a912-cc3e878017c2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestNonaccrual_94b2f5ae-dfb0-45f5-a912-cc3e878017c2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_cbf8af9c-513b-4799-b1ff-66b5be00ff93" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:to="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_cbf8af9c-513b-4799-b1ff-66b5be00ff93" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinancingReceivableNonaccrualInProcessOfForeclosure_4a9413c0-4161-4416-8795-cdaab7dc1d6d" xlink:href="bmrc-20231231.xsd#bmrc_FinancingReceivableNonaccrualInProcessOfForeclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:to="loc_bmrc_FinancingReceivableNonaccrualInProcessOfForeclosure_4a9413c0-4161-4416-8795-cdaab7dc1d6d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_WeightedAverageRatioOfLoansValueToCollateralDependentLoansValue_a5c28f77-cb9e-4f81-bba4-a9af36ff3005" xlink:href="bmrc-20231231.xsd#bmrc_WeightedAverageRatioOfLoansValueToCollateralDependentLoansValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AccountsNotesAndLoansReceivableLineItems_e1130a5e-da0b-4915-8f0f-37a94a8597a0" xlink:to="loc_bmrc_WeightedAverageRatioOfLoansValueToCollateralDependentLoansValue_a5c28f77-cb9e-4f81-bba4-a9af36ff3005" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostofLoanDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostofLoanDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostofLoanDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModificationsLineItems_765876d3-8862-4387-bf33-4557bc4eec0d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModificationsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_0005c9ab-f640-4300-bfeb-944f398d306e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_765876d3-8862-4387-bf33-4557bc4eec0d" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_0005c9ab-f640-4300-bfeb-944f398d306e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_5901d074-0d08-4303-ab1b-75b2a1364de6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_0005c9ab-f640-4300-bfeb-944f398d306e" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_5901d074-0d08-4303-ab1b-75b2a1364de6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_5901d074-0d08-4303-ab1b-75b2a1364de6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_5901d074-0d08-4303-ab1b-75b2a1364de6" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_5901d074-0d08-4303-ab1b-75b2a1364de6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_5901d074-0d08-4303-ab1b-75b2a1364de6" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_c15e7e9c-3d7a-499e-bb15-8394c16f66cf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_c15e7e9c-3d7a-499e-bb15-8394c16f66cf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_fc83a09f-9f80-4fc7-8544-be31f0f5b162" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_fc83a09f-9f80-4fc7-8544-be31f0f5b162" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_24de169f-b751-4de8-affd-db62759b502b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_24de169f-b751-4de8-affd-db62759b502b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_ccc26602-5c4f-4161-b3bc-7cd717ff282b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7e7bd5ad-fcb5-4df4-83cc-da1f3aff63ce" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_ccc26602-5c4f-4161-b3bc-7cd717ff282b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_6c5f55f2-0bb6-44fa-bde7-5514839faff8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_0005c9ab-f640-4300-bfeb-944f398d306e" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_6c5f55f2-0bb6-44fa-bde7-5514839faff8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_6c5f55f2-0bb6-44fa-bde7-5514839faff8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_6c5f55f2-0bb6-44fa-bde7-5514839faff8" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_6c5f55f2-0bb6-44fa-bde7-5514839faff8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_5816b1f9-97ed-41cd-9424-0e7bf38da295" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_6c5f55f2-0bb6-44fa-bde7-5514839faff8" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_5816b1f9-97ed-41cd-9424-0e7bf38da295" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_09f57a83-9353-4f61-ba2e-4883c298f77e" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_5816b1f9-97ed-41cd-9424-0e7bf38da295" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_09f57a83-9353-4f61-ba2e-4883c298f77e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_1b6e6dcd-723b-4c2f-9d1f-b2b75846f45a" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_5816b1f9-97ed-41cd-9424-0e7bf38da295" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_1b6e6dcd-723b-4c2f-9d1f-b2b75846f45a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationAxis_847b1097-7b27-4342-8225-8827edce1f5f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_0005c9ab-f640-4300-bfeb-944f398d306e" xlink:to="loc_us-gaap_LoanRestructuringModificationAxis_847b1097-7b27-4342-8225-8827edce1f5f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationDomain_847b1097-7b27-4342-8225-8827edce1f5f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LoanRestructuringModificationAxis_847b1097-7b27-4342-8225-8827edce1f5f" xlink:to="loc_us-gaap_LoanRestructuringModificationDomain_847b1097-7b27-4342-8225-8827edce1f5f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationDomain_fd5c9e3c-956c-43da-a49e-7d1962a5f98f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LoanRestructuringModificationAxis_847b1097-7b27-4342-8225-8827edce1f5f" xlink:to="loc_us-gaap_LoanRestructuringModificationDomain_fd5c9e3c-956c-43da-a49e-7d1962a5f98f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TermExtensionMember_6b795239-0c77-4244-8e31-09c8343379c5" xlink:href="bmrc-20231231.xsd#bmrc_TermExtensionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LoanRestructuringModificationDomain_fd5c9e3c-956c-43da-a49e-7d1962a5f98f" xlink:to="loc_bmrc_TermExtensionMember_6b795239-0c77-4244-8e31-09c8343379c5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod_03a620d2-5356-47ef-80b0-1778bc3563b7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_765876d3-8862-4387-bf33-4557bc4eec0d" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod_03a620d2-5356-47ef-80b0-1778bc3563b7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModificationToTotalFinancingReceivablesExcludingAccruedInterestPercent_d6d83605-08ab-45d4-bc86-210c67ff1fe6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModificationToTotalFinancingReceivablesExcludingAccruedInterestPercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_765876d3-8862-4387-bf33-4557bc4eec0d" xlink:to="loc_us-gaap_FinancingReceivableModificationToTotalFinancingReceivablesExcludingAccruedInterestPercent_d6d83605-08ab-45d4-bc86-210c67ff1fe6" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofFinancialEffectofLoanModificationsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofFinancialEffectofLoanModificationsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofFinancialEffectofLoanModificationsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModificationsLineItems_d98c3e53-64c2-4e43-a42c-43ade51cb8c9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModificationsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_8649da79-b503-420d-9ecf-a1da5aa43a23" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_d98c3e53-64c2-4e43-a42c-43ade51cb8c9" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_8649da79-b503-420d-9ecf-a1da5aa43a23" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_bd21dd1c-c0cb-4f0d-9f91-fc5144526263" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_8649da79-b503-420d-9ecf-a1da5aa43a23" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_bd21dd1c-c0cb-4f0d-9f91-fc5144526263" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_bd21dd1c-c0cb-4f0d-9f91-fc5144526263_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_bd21dd1c-c0cb-4f0d-9f91-fc5144526263" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_bd21dd1c-c0cb-4f0d-9f91-fc5144526263_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_3c61a8d8-4a34-414f-9834-553e63cfe0a3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_bd21dd1c-c0cb-4f0d-9f91-fc5144526263" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_3c61a8d8-4a34-414f-9834-553e63cfe0a3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_dcfafbfc-fe84-4748-ac05-fe227753b9e9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_3c61a8d8-4a34-414f-9834-553e63cfe0a3" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_dcfafbfc-fe84-4748-ac05-fe227753b9e9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_917fda51-59f9-4d81-b5c2-df461592e374" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_8649da79-b503-420d-9ecf-a1da5aa43a23" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_917fda51-59f9-4d81-b5c2-df461592e374" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_917fda51-59f9-4d81-b5c2-df461592e374_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_917fda51-59f9-4d81-b5c2-df461592e374" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_917fda51-59f9-4d81-b5c2-df461592e374_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_f155e7fb-a691-49f8-9672-6f13a3b6958b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_917fda51-59f9-4d81-b5c2-df461592e374" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_f155e7fb-a691-49f8-9672-6f13a3b6958b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_759e7522-e1a5-4c9c-ab69-9bda3ebbd578" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_f155e7fb-a691-49f8-9672-6f13a3b6958b" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_759e7522-e1a5-4c9c-ab69-9bda3ebbd578" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_0982689a-9cea-4fd9-b8e9-93b92940a80d" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_f155e7fb-a691-49f8-9672-6f13a3b6958b" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_0982689a-9cea-4fd9-b8e9-93b92940a80d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationAxis_0bec7706-8925-4707-ab42-2b2c63d7a54b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_8649da79-b503-420d-9ecf-a1da5aa43a23" xlink:to="loc_us-gaap_LoanRestructuringModificationAxis_0bec7706-8925-4707-ab42-2b2c63d7a54b" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationDomain_0bec7706-8925-4707-ab42-2b2c63d7a54b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LoanRestructuringModificationAxis_0bec7706-8925-4707-ab42-2b2c63d7a54b" xlink:to="loc_us-gaap_LoanRestructuringModificationDomain_0bec7706-8925-4707-ab42-2b2c63d7a54b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoanRestructuringModificationDomain_eb439d5e-b47f-42da-8225-1980301a7ef4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoanRestructuringModificationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LoanRestructuringModificationAxis_0bec7706-8925-4707-ab42-2b2c63d7a54b" xlink:to="loc_us-gaap_LoanRestructuringModificationDomain_eb439d5e-b47f-42da-8225-1980301a7ef4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ExtendedMaturityMember_1ec3ee19-5721-4034-9287-30ee12f7c3cf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ExtendedMaturityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LoanRestructuringModificationDomain_eb439d5e-b47f-42da-8225-1980301a7ef4" xlink:to="loc_us-gaap_ExtendedMaturityMember_1ec3ee19-5721-4034-9287-30ee12f7c3cf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModifiedWeightedAverageTermIncreaseFromModification_f0595e55-6a63-459a-b8d6-4e6018fa4b55" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModifiedWeightedAverageTermIncreaseFromModification"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_d98c3e53-64c2-4e43-a42c-43ade51cb8c9" xlink:to="loc_us-gaap_FinancingReceivableModifiedWeightedAverageTermIncreaseFromModification_f0595e55-6a63-459a-b8d6-4e6018fa4b55" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostandPaymentStatusofLoansDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostandPaymentStatusofLoansDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAmortizedCostandPaymentStatusofLoansDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModificationsLineItems_f85e1adb-f788-4792-879c-3e45544b0b6e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModificationsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_9b781a1c-1f93-45b8-89c9-256a1b1e61ff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_f85e1adb-f788-4792-879c-3e45544b0b6e" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_9b781a1c-1f93-45b8-89c9-256a1b1e61ff" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_22a99ba1-5396-461e-b802-17af1fcf274b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_9b781a1c-1f93-45b8-89c9-256a1b1e61ff" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_22a99ba1-5396-461e-b802-17af1fcf274b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_22a99ba1-5396-461e-b802-17af1fcf274b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_22a99ba1-5396-461e-b802-17af1fcf274b" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_22a99ba1-5396-461e-b802-17af1fcf274b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_22a99ba1-5396-461e-b802-17af1fcf274b" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_4d81b7de-eaa5-4f7e-85bb-381e6f0d7d9c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_4d81b7de-eaa5-4f7e-85bb-381e6f0d7d9c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_532a29de-6811-4f9a-8f06-77b17a043696" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_532a29de-6811-4f9a-8f06-77b17a043696" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_919785fb-4c2c-45a8-bdd2-a68ab206c0d7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_919785fb-4c2c-45a8-bdd2-a68ab206c0d7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_1e7d3ae5-2df9-454e-a989-738e7edc6221" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_16d46fac-c7e5-4dbe-bf81-9c7e6d34c044" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_1e7d3ae5-2df9-454e-a989-738e7edc6221" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_9b781a1c-1f93-45b8-89c9-256a1b1e61ff" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1f8b1f18-7681-4bbc-80c5-cf61eef0df0e" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_6ae127a4-c0ef-4b20-b5fa-52e6c12c7203" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_bmrc_CommercialAndIndustrialMember_6ae127a4-c0ef-4b20-b5fa-52e6c12c7203" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_ae900ea7-43c0-4e00-89c3-b7ec502e2c98" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_ae900ea7-43c0-4e00-89c3-b7ec502e2c98" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_0511ca5e-8263-4fb0-9fc0-7cf4e755bf1e" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_0511ca5e-8263-4fb0-9fc0-7cf4e755bf1e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_24883673-e02c-487e-8e45-7e9b2ca8a555" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_us-gaap_ConstructionLoansMember_24883673-e02c-487e-8e45-7e9b2ca8a555" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_12dac300-4125-43d1-8efb-b4cf13601b50" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_us-gaap_HomeEquityLoanMember_12dac300-4125-43d1-8efb-b4cf13601b50" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_47116e00-8871-42a4-b6b3-e35d6bb4ff8c" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_bmrc_OtherResidentialLoanMember_47116e00-8871-42a4-b6b3-e35d6bb4ff8c" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_ddc4f74d-08c4-4b01-9930-8e3b77283df5" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_7da914b3-590d-473d-9212-0f6d3f6b90ea" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_ddc4f74d-08c4-4b01-9930-8e3b77283df5" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_9b781a1c-1f93-45b8-89c9-256a1b1e61ff" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesPeriodPastDueDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueAxis_262c735f-7b5a-4cd8-9d9a-b994a2ee9fb2" xlink:to="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialAssetNotPastDueMember_43e4811d-c852-431d-a6dc-cb03f48d509a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialAssetNotPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:to="loc_us-gaap_FinancialAssetNotPastDueMember_43e4811d-c852-431d-a6dc-cb03f48d509a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivables30To59DaysPastDueMember_16467c17-c750-4d29-b838-65c1383b9f80" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivables30To59DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:to="loc_us-gaap_FinancingReceivables30To59DaysPastDueMember_16467c17-c750-4d29-b838-65c1383b9f80" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivables60To89DaysPastDueMember_98222071-c5e5-4f69-a480-35d138c0ea72" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivables60To89DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:to="loc_us-gaap_FinancingReceivables60To89DaysPastDueMember_98222071-c5e5-4f69-a480-35d138c0ea72" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember_14882df4-5ca5-47d9-a045-7651a020bf3a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablesPeriodPastDueDomain_588d69d4-38cd-4bb9-9080-b77969843449" xlink:to="loc_us-gaap_FinancingReceivablesEqualToGreaterThan90DaysPastDueMember_14882df4-5ca5-47d9-a045-7651a020bf3a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod_aa29ab6b-c906-47ad-9deb-ec82f00bd795" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_f85e1adb-f788-4792-879c-3e45544b0b6e" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestModifiedPeriod_aa29ab6b-c906-47ad-9deb-ec82f00bd795" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinancingReceivableNonaccrualModifiedInPeriodAmount_e591dbb7-f254-4936-880e-29a6f88272a0" xlink:href="bmrc-20231231.xsd#bmrc_FinancingReceivableNonaccrualModifiedInPeriodAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_f85e1adb-f788-4792-879c-3e45544b0b6e" xlink:to="loc_bmrc_FinancingReceivableNonaccrualModifiedInPeriodAmount_e591dbb7-f254-4936-880e-29a6f88272a0" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAllocationoftheAllowanceforCreditLossesonLoansDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofAllocationoftheAllowanceforCreditLossesonLoansDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAllocationoftheAllowanceforCreditLossesonLoansDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableModificationsLineItems_3a94dd1f-d266-44e6-b209-683d3e429ac8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableModificationsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_57468fc7-7e23-42cb-86a1-5503855710fc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_3a94dd1f-d266-44e6-b209-683d3e429ac8" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_57468fc7-7e23-42cb-86a1-5503855710fc" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_7d351135-6615-48fa-9f6a-080f13741a2d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_57468fc7-7e23-42cb-86a1-5503855710fc" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_7d351135-6615-48fa-9f6a-080f13741a2d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7d351135-6615-48fa-9f6a-080f13741a2d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_7d351135-6615-48fa-9f6a-080f13741a2d" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_7d351135-6615-48fa-9f6a-080f13741a2d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_7d351135-6615-48fa-9f6a-080f13741a2d" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_4da58fa0-c83e-4392-9c7c-9ca56b6652cb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_4da58fa0-c83e-4392-9c7c-9ca56b6652cb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_3c7ad21e-a508-42ab-95e7-c8f459f85b45" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_3c7ad21e-a508-42ab-95e7-c8f459f85b45" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_a3ae6179-5f63-403e-99d3-d195c0896e45" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_a3ae6179-5f63-403e-99d3-d195c0896e45" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_30cc9922-4415-4667-b935-78daa64248b0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_30cc9922-4415-4667-b935-78daa64248b0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnallocatedFinancingReceivablesMember_8c46a1b5-f426-4cfa-bb37-bbd7555df538" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_UnallocatedFinancingReceivablesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6f9dcbb6-67c5-4b70-8db8-90c5e9453909" xlink:to="loc_us-gaap_UnallocatedFinancingReceivablesMember_8c46a1b5-f426-4cfa-bb37-bbd7555df538" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1c25408b-114e-435c-b96d-d25fa7b924d5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_57468fc7-7e23-42cb-86a1-5503855710fc" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1c25408b-114e-435c-b96d-d25fa7b924d5" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_1c25408b-114e-435c-b96d-d25fa7b924d5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1c25408b-114e-435c-b96d-d25fa7b924d5" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_1c25408b-114e-435c-b96d-d25fa7b924d5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_1c25408b-114e-435c-b96d-d25fa7b924d5" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_def84700-0771-4ac1-9893-0b8712999405" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_bmrc_CommercialAndIndustrialMember_def84700-0771-4ac1-9893-0b8712999405" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_3ee7b450-92cd-44ac-a01e-f2c1d4f29469" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_3ee7b450-92cd-44ac-a01e-f2c1d4f29469" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_8d2825fe-805a-49fe-b710-4304973fce0c" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_8d2825fe-805a-49fe-b710-4304973fce0c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_c1e51f5c-5b68-4cde-9821-d7397df78d52" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_us-gaap_ConstructionLoansMember_c1e51f5c-5b68-4cde-9821-d7397df78d52" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_9f0ae745-005f-476a-a873-db883eff0c3d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_us-gaap_HomeEquityLoanMember_9f0ae745-005f-476a-a873-db883eff0c3d" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_db8998a0-5275-464e-94bf-b74e8c6a3db9" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_bmrc_OtherResidentialLoanMember_db8998a0-5275-464e-94bf-b74e8c6a3db9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_3ecd20de-bf1c-4410-90af-2112b0d4d9ab" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_51a8316e-f1fd-454b-8a09-8762eac6d0ce" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_3ecd20de-bf1c-4410-90af-2112b0d4d9ab" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AllowanceForCreditLossAllocationAxis_6a6b315c-96a4-44d8-9b34-0b7178880d78" xlink:href="bmrc-20231231.xsd#bmrc_AllowanceForCreditLossAllocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableTroubledDebtRestructuringsTable_57468fc7-7e23-42cb-86a1-5503855710fc" xlink:to="loc_bmrc_AllowanceForCreditLossAllocationAxis_6a6b315c-96a4-44d8-9b34-0b7178880d78" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AllowanceForCreditLossAllocationDomain_6a6b315c-96a4-44d8-9b34-0b7178880d78_default" xlink:href="bmrc-20231231.xsd#bmrc_AllowanceForCreditLossAllocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_bmrc_AllowanceForCreditLossAllocationAxis_6a6b315c-96a4-44d8-9b34-0b7178880d78" xlink:to="loc_bmrc_AllowanceForCreditLossAllocationDomain_6a6b315c-96a4-44d8-9b34-0b7178880d78_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AllowanceForCreditLossAllocationDomain_5faf905c-1396-4ac6-981c-a7305fd5c951" xlink:href="bmrc-20231231.xsd#bmrc_AllowanceForCreditLossAllocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_bmrc_AllowanceForCreditLossAllocationAxis_6a6b315c-96a4-44d8-9b34-0b7178880d78" xlink:to="loc_bmrc_AllowanceForCreditLossAllocationDomain_5faf905c-1396-4ac6-981c-a7305fd5c951" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ModeledExpectedCreditLossesMember_cc77dc6f-259b-415c-a384-7ae6d4284664" xlink:href="bmrc-20231231.xsd#bmrc_ModeledExpectedCreditLossesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_AllowanceForCreditLossAllocationDomain_5faf905c-1396-4ac6-981c-a7305fd5c951" xlink:to="loc_bmrc_ModeledExpectedCreditLossesMember_cc77dc6f-259b-415c-a384-7ae6d4284664" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_QualitativeAdjustmentsMember_3aae4b69-21a4-45a2-b0e5-1c25602aef8b" xlink:href="bmrc-20231231.xsd#bmrc_QualitativeAdjustmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_AllowanceForCreditLossAllocationDomain_5faf905c-1396-4ac6-981c-a7305fd5c951" xlink:to="loc_bmrc_QualitativeAdjustmentsMember_3aae4b69-21a4-45a2-b0e5-1c25602aef8b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SpecificAllocationsMember_a6f4db5a-3cb4-4d39-b19b-bbe3f2cd7a33" xlink:href="bmrc-20231231.xsd#bmrc_SpecificAllocationsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_AllowanceForCreditLossAllocationDomain_5faf905c-1396-4ac6-981c-a7305fd5c951" xlink:to="loc_bmrc_SpecificAllocationsMember_a6f4db5a-3cb4-4d39-b19b-bbe3f2cd7a33" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_90b072f9-26a2-4daa-bb96-63a9fa21993d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableModificationsLineItems_3a94dd1f-d266-44e6-b209-683d3e429ac8" xlink:to="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_90b072f9-26a2-4daa-bb96-63a9fa21993d" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAllowanceforCreditLossesonLoansDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansScheduleofAllowanceforCreditLossesonLoansDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansScheduleofAllowanceforCreditLossesonLoansDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_db50b4d8-ec94-48b4-9209-15a242c7a5ea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_96004c02-b8e4-48c6-b4cd-42b5375259c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_db50b4d8-ec94-48b4-9209-15a242c7a5ea" xlink:to="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_96004c02-b8e4-48c6-b4cd-42b5375259c4" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_2164f491-86d9-49e7-b444-52518e3e790b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_96004c02-b8e4-48c6-b4cd-42b5375259c4" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_2164f491-86d9-49e7-b444-52518e3e790b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_2164f491-86d9-49e7-b444-52518e3e790b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_2164f491-86d9-49e7-b444-52518e3e790b" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_2164f491-86d9-49e7-b444-52518e3e790b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_2164f491-86d9-49e7-b444-52518e3e790b" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialPortfolioSegmentMember_faabefc9-7346-4832-bab8-a27b0eef79e7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:to="loc_us-gaap_CommercialPortfolioSegmentMember_faabefc9-7346-4832-bab8-a27b0eef79e7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_8560d2e7-454e-4260-a62f-ddd9f30f6591" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_8560d2e7-454e-4260-a62f-ddd9f30f6591" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_b5940528-9839-4406-a041-08a8c2fed167" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_b5940528-9839-4406-a041-08a8c2fed167" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConsumerPortfolioSegmentMember_15780381-dc80-4bca-b124-cc19b0d633c2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConsumerPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:to="loc_us-gaap_ConsumerPortfolioSegmentMember_15780381-dc80-4bca-b124-cc19b0d633c2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnallocatedFinancingReceivablesMember_c2c4f046-7ee4-4b1c-ab4f-e97c1cf93e64" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_UnallocatedFinancingReceivablesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_75110c26-c47a-49b6-829d-557027ac8dfa" xlink:to="loc_us-gaap_UnallocatedFinancingReceivablesMember_c2c4f046-7ee4-4b1c-ab4f-e97c1cf93e64" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_3ddf651c-6436-495b-81c1-4a3ee1d74a37" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFinancingReceivableAllowanceForCreditLossesTable_96004c02-b8e4-48c6-b4cd-42b5375259c4" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_3ddf651c-6436-495b-81c1-4a3ee1d74a37" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_3ddf651c-6436-495b-81c1-4a3ee1d74a37_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_3ddf651c-6436-495b-81c1-4a3ee1d74a37" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_3ddf651c-6436-495b-81c1-4a3ee1d74a37_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_3ddf651c-6436-495b-81c1-4a3ee1d74a37" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialAndIndustrialMember_531fd8c0-a83d-4aa6-a20e-5d29c27bd470" xlink:href="bmrc-20231231.xsd#bmrc_CommercialAndIndustrialMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_bmrc_CommercialAndIndustrialMember_531fd8c0-a83d-4aa6-a20e-5d29c27bd470" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_193881b2-338a-4ec0-bc6f-feb8185bef5b" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_bmrc_CommercialRealEstateLoanOwnerOccupiedMember_193881b2-338a-4ec0-bc6f-feb8185bef5b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_1ef81a63-d1a1-4b8f-b4de-af03aa9b7683" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_1ef81a63-d1a1-4b8f-b4de-af03aa9b7683" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConstructionLoansMember_c7ac5302-c84b-4f2c-b116-7e41364d3a69" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_us-gaap_ConstructionLoansMember_c7ac5302-c84b-4f2c-b116-7e41364d3a69" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityLoanMember_f5eee83d-f478-4a18-afd8-48018a25f8cd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_us-gaap_HomeEquityLoanMember_f5eee83d-f478-4a18-afd8-48018a25f8cd" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_93a0dd21-9f7f-4647-a1b7-9e23972ce5ea" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_bmrc_OtherResidentialLoanMember_93a0dd21-9f7f-4647-a1b7-9e23972ce5ea" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InstallmentAndOtherConsumerMember_e99be7b0-c332-45de-9959-4774c8340108" xlink:href="bmrc-20231231.xsd#bmrc_InstallmentAndOtherConsumerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_da63e731-49b9-4c2d-8ce5-cf033ba29526" xlink:to="loc_bmrc_InstallmentAndOtherConsumerMember_e99be7b0-c332-45de-9959-4774c8340108" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AllowanceForLoanAndLeaseLossesRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableAllowanceForCreditLossesLineItems_db50b4d8-ec94-48b4-9209-15a242c7a5ea" xlink:to="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_dbb2bf95-e545-4823-9907-0715db66f0c2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:to="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_dbb2bf95-e545-4823-9907-0715db66f0c2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal_75acded6-55f6-4a8b-b44b-ceb2f2072e97" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestCreditLossExpenseReversal_75acded6-55f6-4a8b-b44b-ceb2f2072e97" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossPurchasedWithCreditDeteriorationIncrease_c117bf85-b50d-4057-ad1a-4f6f938854df" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossPurchasedWithCreditDeteriorationIncrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:to="loc_us-gaap_FinancingReceivableAllowanceForCreditLossPurchasedWithCreditDeteriorationIncrease_c117bf85-b50d-4057-ad1a-4f6f938854df" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff_a44eecfe-569a-4dbd-8e60-ac9a8dcf48cc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossWriteoff_a44eecfe-569a-4dbd-8e60-ac9a8dcf48cc" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossRecovery_9dba9fc0-c606-4169-bc84-fe43c117ae94" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossRecovery"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AllowanceForLoanAndLeaseLossesRollForward_74b3c749-a5e4-41e8-ac18-6d6093fc031b" xlink:to="loc_us-gaap_FinancingReceivableExcludingAccruedInterestAllowanceForCreditLossRecovery_9dba9fc0-c606-4169-bc84-fe43c117ae94" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest_4c7bdb00-ea04-4eac-a843-9bfe6ba808b7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableAllowanceForCreditLossExcludingAccruedInterest"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansPledgedLoansNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansPledgedLoansNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansPledgedLoansNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_982a93a6-58cc-4976-a50a-3e2515cb7c6d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_dbf18681-85e8-42cd-8408-cb9b10f4eea3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_982a93a6-58cc-4976-a50a-3e2515cb7c6d" xlink:to="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_dbf18681-85e8-42cd-8408-cb9b10f4eea3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankAxis_108a1903-170f-4cc9-998c-56590b5c1829" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_dbf18681-85e8-42cd-8408-cb9b10f4eea3" xlink:to="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankAxis_108a1903-170f-4cc9-998c-56590b5c1829" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain_108a1903-170f-4cc9-998c-56590b5c1829_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankAxis_108a1903-170f-4cc9-998c-56590b5c1829" xlink:to="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain_108a1903-170f-4cc9-998c-56590b5c1829_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain_536fd9a7-27df-451f-bbb1-fed73b4b1066" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankAxis_108a1903-170f-4cc9-998c-56590b5c1829" xlink:to="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain_536fd9a7-27df-451f-bbb1-fed73b4b1066" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_FederalHomeLoanBankOfSanFranciscoMember_cfbba45d-5e6e-476a-b159-70d0d7a580cb" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_FederalHomeLoanBankOfSanFranciscoMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_FederalHomeLoanBankAdvancesBranchOfFHLBBankStateDomain_536fd9a7-27df-451f-bbb1-fed73b4b1066" xlink:to="loc_srt_FederalHomeLoanBankOfSanFranciscoMember_cfbba45d-5e6e-476a-b159-70d0d7a580cb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_42f388a8-8202-48a7-aae1-58265706e77b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_dbf18681-85e8-42cd-8408-cb9b10f4eea3" xlink:to="loc_us-gaap_FinancialInstrumentAxis_42f388a8-8202-48a7-aae1-58265706e77b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_42f388a8-8202-48a7-aae1-58265706e77b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_42f388a8-8202-48a7-aae1-58265706e77b" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_42f388a8-8202-48a7-aae1-58265706e77b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7108aecb-e38d-47de-9f65-501938e4b798" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_42f388a8-8202-48a7-aae1-58265706e77b" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7108aecb-e38d-47de-9f65-501938e4b798" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherResidentialLoanMember_2db773f5-dc95-419a-ad63-7f6a7ddb78f2" xlink:href="bmrc-20231231.xsd#bmrc_OtherResidentialLoanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_7108aecb-e38d-47de-9f65-501938e4b798" xlink:to="loc_bmrc_OtherResidentialLoanMember_2db773f5-dc95-419a-ad63-7f6a7ddb78f2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityAxis_6047cbc6-6d6e-42e0-951d-09e211e37ea5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralTable_dbf18681-85e8-42cd-8408-cb9b10f4eea3" xlink:to="loc_us-gaap_LineOfCreditFacilityAxis_6047cbc6-6d6e-42e0-951d-09e211e37ea5" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_6047cbc6-6d6e-42e0-951d-09e211e37ea5_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityLenderDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_6047cbc6-6d6e-42e0-951d-09e211e37ea5" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_6047cbc6-6d6e-42e0-951d-09e211e37ea5_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_97041d7a-7495-4ee7-911c-4f741ecb6494" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityLenderDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_6047cbc6-6d6e-42e0-951d-09e211e37ea5" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_97041d7a-7495-4ee7-911c-4f741ecb6494" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalReserveBankMember_3c5d554d-db60-4453-9c13-04beb3b467b8" xlink:href="bmrc-20231231.xsd#bmrc_FederalReserveBankMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLenderDomain_97041d7a-7495-4ee7-911c-4f741ecb6494" xlink:to="loc_bmrc_FederalReserveBankMember_3c5d554d-db60-4453-9c13-04beb3b467b8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentCollateralAmount_b81b1317-6de3-4221-a94d-ceae153538af" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentCollateralAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsOwnedAndPledgedAsCollateralLineItems_982a93a6-58cc-4976-a50a-3e2515cb7c6d" xlink:to="loc_us-gaap_DebtInstrumentCollateralAmount_b81b1317-6de3-4221-a94d-ceae153538af" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansRelatedPartyLoansNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#LoansandAllowanceforCreditLossesonLoansRelatedPartyLoansNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/LoansandAllowanceforCreditLossesonLoansRelatedPartyLoansNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionLineItems_3cef42cd-48cc-4eba-8bb7-cbe70762d962" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RelatedPartyTransactionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_aa0bcd49-6fbd-4b2a-9ec7-a814ff944048" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_3cef42cd-48cc-4eba-8bb7-cbe70762d962" xlink:to="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_aa0bcd49-6fbd-4b2a-9ec7-a814ff944048" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RelatedPartyTransactionsByRelatedPartyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRelatedPartyTransactionsByRelatedPartyTable_aa0bcd49-6fbd-4b2a-9ec7-a814ff944048" xlink:to="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8" xlink:to="loc_us-gaap_RelatedPartyDomain_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RelatedPartyDomain_f46222a4-ea26-4d76-a744-9c871267a473" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RelatedPartyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RelatedPartyTransactionsByRelatedPartyAxis_09a242eb-3452-4e0d-900b-7ea9f4f3bcd8" xlink:to="loc_us-gaap_RelatedPartyDomain_f46222a4-ea26-4d76-a744-9c871267a473" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DirectorsOfficersPrincipalShareholdersAndAssociatesMember_7aa4d20d-88ac-4be3-a1cb-12ea05fdcbce" xlink:href="bmrc-20231231.xsd#bmrc_DirectorsOfficersPrincipalShareholdersAndAssociatesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyDomain_f46222a4-ea26-4d76-a744-9c871267a473" xlink:to="loc_bmrc_DirectorsOfficersPrincipalShareholdersAndAssociatesMember_7aa4d20d-88ac-4be3-a1cb-12ea05fdcbce" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnusedCommitmentsToExtendCredit_cfca28b3-b11a-4e1b-ab97-d5a58d6fcfba" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_UnusedCommitmentsToExtendCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RelatedPartyTransactionLineItems_3cef42cd-48cc-4eba-8bb7-cbe70762d962" xlink:to="loc_us-gaap_UnusedCommitmentsToExtendCredit_cfca28b3-b11a-4e1b-ab97-d5a58d6fcfba" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BankPremisesandEquipmentScheduleofBankPremisesandEquipmentDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BankPremisesandEquipmentScheduleofBankPremisesandEquipmentDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BankPremisesandEquipmentScheduleofBankPremisesandEquipmentDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_c7a0e9eb-3c14-40c3-9db6-2cd039aa3aa9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_c7a0e9eb-3c14-40c3-9db6-2cd039aa3aa9" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_8e1c0b08-cfc4-4862-9c76-888ec94acfa9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_c7a0e9eb-3c14-40c3-9db6-2cd039aa3aa9" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_8e1c0b08-cfc4-4862-9c76-888ec94acfa9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_8e1c0b08-cfc4-4862-9c76-888ec94acfa9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_8e1c0b08-cfc4-4862-9c76-888ec94acfa9" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_8e1c0b08-cfc4-4862-9c76-888ec94acfa9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_8e1c0b08-cfc4-4862-9c76-888ec94acfa9" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LeaseholdImprovementsMember_429ec56e-bb66-4cd7-b5ba-0461d8cac202" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LeaseholdImprovementsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:to="loc_us-gaap_LeaseholdImprovementsMember_429ec56e-bb66-4cd7-b5ba-0461d8cac202" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FurnitureAndFixturesMember_191c82e3-7473-4bc8-a406-0d490889a36f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FurnitureAndFixturesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:to="loc_us-gaap_FurnitureAndFixturesMember_191c82e3-7473-4bc8-a406-0d490889a36f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BuildingMember_50a4b7e8-d422-4eee-85a8-f6afdf3d713a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BuildingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:to="loc_us-gaap_BuildingMember_50a4b7e8-d422-4eee-85a8-f6afdf3d713a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LandMember_12e5f65f-1155-4c35-9da1-f1795705eeba" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LandMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:to="loc_us-gaap_LandMember_12e5f65f-1155-4c35-9da1-f1795705eeba" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FinanceLeaseRightOfUseAssetsMember_78ff5dce-5c48-4f89-9a28-22588b4d181a" xlink:href="bmrc-20231231.xsd#bmrc_FinanceLeaseRightOfUseAssetsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_362174e9-e908-4eea-a3e7-2d68dab96b31" xlink:to="loc_bmrc_FinanceLeaseRightOfUseAssetsMember_78ff5dce-5c48-4f89-9a28-22588b4d181a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_52aabb8f-306b-41a8-a338-f9db4094c28c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_52aabb8f-306b-41a8-a338-f9db4094c28c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_3ace6875-03d1-437b-9787-40977a29b2c0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_FinanceLeaseRightOfUseAssetBeforeAccumulatedAmortization_3ace6875-03d1-437b-9787-40977a29b2c0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetBeforeAccumulatedDepreciationAndAmortization_9d8560dd-608a-4e8b-ae6d-3fc60879fb28" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetBeforeAccumulatedDepreciationAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetBeforeAccumulatedDepreciationAndAmortization_9d8560dd-608a-4e8b-ae6d-3fc60879fb28" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAccumulatedDepreciationAndAmortization_2e036a9b-c0fa-4a66-a49d-12dd5782d30f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAccumulatedDepreciationAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAccumulatedDepreciationAndAmortization_2e036a9b-c0fa-4a66-a49d-12dd5782d30f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization_234db4d5-23b8-4d54-ae53-1dc570575475" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_8f3a6c51-f754-4809-895c-a1fd0d0aa666" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization_234db4d5-23b8-4d54-ae53-1dc570575475" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsLinesofCreditandBorrowingAgreementsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BorrowingsandOtherObligationsLinesofCreditandBorrowingAgreementsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsLinesofCreditandBorrowingAgreementsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLineItems_2746ab29-14ce-47e6-99f5-3ec904e30e2e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_2746ab29-14ce-47e6-99f5-3ec904e30e2e" xlink:to="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_497088f6-0e93-42a1-926c-a1168063e37a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:to="loc_us-gaap_CreditFacilityAxis_497088f6-0e93-42a1-926c-a1168063e37a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_497088f6-0e93-42a1-926c-a1168063e37a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_497088f6-0e93-42a1-926c-a1168063e37a" xlink:to="loc_us-gaap_CreditFacilityDomain_497088f6-0e93-42a1-926c-a1168063e37a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_7fd65e27-a195-4051-89e0-131375df3b81" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_497088f6-0e93-42a1-926c-a1168063e37a" xlink:to="loc_us-gaap_CreditFacilityDomain_7fd65e27-a195-4051-89e0-131375df3b81" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_bfe0c931-9fd9-4b35-8f9f-4050dacc343f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_7fd65e27-a195-4051-89e0-131375df3b81" xlink:to="loc_us-gaap_LineOfCreditMember_bfe0c931-9fd9-4b35-8f9f-4050dacc343f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityAxis_d61092d5-a706-459b-918f-bf696b865ce1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:to="loc_us-gaap_LineOfCreditFacilityAxis_d61092d5-a706-459b-918f-bf696b865ce1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_d61092d5-a706-459b-918f-bf696b865ce1_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityLenderDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_d61092d5-a706-459b-918f-bf696b865ce1" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_d61092d5-a706-459b-918f-bf696b865ce1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityLenderDomain_f29a95ab-3925-4816-99f8-d187c2f711b6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityLenderDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LineOfCreditFacilityAxis_d61092d5-a706-459b-918f-bf696b865ce1" xlink:to="loc_us-gaap_LineOfCreditFacilityLenderDomain_f29a95ab-3925-4816-99f8-d187c2f711b6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanBankBorrowingsMember_bff465d1-c152-4942-8ca1-aa3bbc0e9422" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanBankBorrowingsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLenderDomain_f29a95ab-3925-4816-99f8-d187c2f711b6" xlink:to="loc_us-gaap_FederalHomeLoanBankBorrowingsMember_bff465d1-c152-4942-8ca1-aa3bbc0e9422" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalFundsPurchasedMember_6e3d0a96-9974-45e4-a828-48c00a6e731d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalFundsPurchasedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLenderDomain_f29a95ab-3925-4816-99f8-d187c2f711b6" xlink:to="loc_us-gaap_FederalFundsPurchasedMember_6e3d0a96-9974-45e4-a828-48c00a6e731d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalReserveBankAdvancesMember_52971153-f060-4e97-9ccc-60ecd3a39829" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalReserveBankAdvancesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLenderDomain_f29a95ab-3925-4816-99f8-d187c2f711b6" xlink:to="loc_us-gaap_FederalReserveBankAdvancesMember_52971153-f060-4e97-9ccc-60ecd3a39829" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_64afd339-b07b-4ae1-9574-9132ec3eb47d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_64afd339-b07b-4ae1-9574-9132ec3eb47d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_64afd339-b07b-4ae1-9574-9132ec3eb47d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_64afd339-b07b-4ae1-9574-9132ec3eb47d" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_64afd339-b07b-4ae1-9574-9132ec3eb47d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_f5a59abd-4730-4166-a03d-51043297521a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_64afd339-b07b-4ae1-9574-9132ec3eb47d" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_f5a59abd-4730-4166-a03d-51043297521a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnsecuredDebtMember_099deead-4d30-44e7-a0d4-d1a9fad942cc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_UnsecuredDebtMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_f5a59abd-4730-4166-a03d-51043297521a" xlink:to="loc_us-gaap_UnsecuredDebtMember_099deead-4d30-44e7-a0d4-d1a9fad942cc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeAxis_7a9e501b-b28d-4acf-bfa6-33bb468b4370" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LineOfCreditFacilityTable_7de57c51-4c64-4bde-8f51-4fa4da9ffb6e" xlink:to="loc_us-gaap_ShortTermDebtTypeAxis_7a9e501b-b28d-4acf-bfa6-33bb468b4370" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_7a9e501b-b28d-4acf-bfa6-33bb468b4370_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_7a9e501b-b28d-4acf-bfa6-33bb468b4370" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_7a9e501b-b28d-4acf-bfa6-33bb468b4370_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_c9b166de-c663-45c0-8b32-261da0924af6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_7a9e501b-b28d-4acf-bfa6-33bb468b4370" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_c9b166de-c663-45c0-8b32-261da0924af6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalReserveBankAdvancesMember_0f5ba9b9-4af3-4058-b02f-d7fae6f06e92" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalReserveBankAdvancesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_c9b166de-c663-45c0-8b32-261da0924af6" xlink:to="loc_us-gaap_FederalReserveBankAdvancesMember_0f5ba9b9-4af3-4058-b02f-d7fae6f06e92" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalReserveBankTermFundingProgramMember_0199ed2c-69ef-4b71-af84-704bdaf45ddd" xlink:href="bmrc-20231231.xsd#bmrc_FederalReserveBankTermFundingProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_c9b166de-c663-45c0-8b32-261da0924af6" xlink:to="loc_bmrc_FederalReserveBankTermFundingProgramMember_0199ed2c-69ef-4b71-af84-704bdaf45ddd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityCurrentBorrowingCapacity_c2367d72-013a-46c2-be33-9883a8c9fbed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityCurrentBorrowingCapacity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LineOfCreditFacilityLineItems_2746ab29-14ce-47e6-99f5-3ec904e30e2e" xlink:to="loc_us-gaap_LineOfCreditFacilityCurrentBorrowingCapacity_c2367d72-013a-46c2-be33-9883a8c9fbed" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsSubordinatedDebentureandOtherObligationsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BorrowingsandOtherObligationsSubordinatedDebentureandOtherObligationsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsSubordinatedDebentureandOtherObligationsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_314fa373-8e11-41c9-8580-282e6d134fa3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_DebtInstrumentTable_314fa373-8e11-41c9-8580-282e6d134fa3" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_26582eed-cd5b-4cee-b2f4-231a7c07af8d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_314fa373-8e11-41c9-8580-282e6d134fa3" xlink:to="loc_us-gaap_DebtInstrumentAxis_26582eed-cd5b-4cee-b2f4-231a7c07af8d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_26582eed-cd5b-4cee-b2f4-231a7c07af8d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_26582eed-cd5b-4cee-b2f4-231a7c07af8d" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_26582eed-cd5b-4cee-b2f4-231a7c07af8d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_a1abfab3-8a1c-4df8-8cf3-5020029b9fa5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_26582eed-cd5b-4cee-b2f4-231a7c07af8d" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_a1abfab3-8a1c-4df8-8cf3-5020029b9fa5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_NorCalCommunityBancorpTrustIIMember_7c059fbd-a539-4f0a-a3b0-3d468e2989f0" xlink:href="bmrc-20231231.xsd#bmrc_NorCalCommunityBancorpTrustIIMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_a1abfab3-8a1c-4df8-8cf3-5020029b9fa5" xlink:to="loc_bmrc_NorCalCommunityBancorpTrustIIMember_7c059fbd-a539-4f0a-a3b0-3d468e2989f0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_f7a70f7e-4903-4614-8c3c-83c131a1bb06" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_314fa373-8e11-41c9-8580-282e6d134fa3" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_f7a70f7e-4903-4614-8c3c-83c131a1bb06" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_f7a70f7e-4903-4614-8c3c-83c131a1bb06_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_f7a70f7e-4903-4614-8c3c-83c131a1bb06" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_f7a70f7e-4903-4614-8c3c-83c131a1bb06_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_81356f50-1c85-479a-a3b9-768456460ecd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_f7a70f7e-4903-4614-8c3c-83c131a1bb06" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_81356f50-1c85-479a-a3b9-768456460ecd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubordinatedDebtMember_304e5903-be09-4992-aeb5-c61734703def" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubordinatedDebtMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_81356f50-1c85-479a-a3b9-768456460ecd" xlink:to="loc_us-gaap_SubordinatedDebtMember_304e5903-be09-4992-aeb5-c61734703def" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiability_e1f55ff1-1e7d-472c-89f4-46e9c9a416f4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinanceLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_FinanceLeaseLiability_e1f55ff1-1e7d-472c-89f4-46e9c9a416f4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinanceLeaseLiabilityStatementOfFinancialPositionExtensibleList_e617eec6-28a7-4829-ae70-096b24ad0e5d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinanceLeaseLiabilityStatementOfFinancialPositionExtensibleList"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_FinanceLeaseLiabilityStatementOfFinancialPositionExtensibleList_e617eec6-28a7-4829-ae70-096b24ad0e5d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentCarryingAmount_8c62dc9a-7b0a-49b8-8d4c-5a98c932aa50" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentCarryingAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_DebtInstrumentCarryingAmount_8c62dc9a-7b0a-49b8-8d4c-5a98c932aa50" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfDebt_8615438d-beb0-40aa-a466-a6c48edc104d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RepaymentsOfDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_RepaymentsOfDebt_8615438d-beb0-40aa-a466-a6c48edc104d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateEffectivePercentage_b87db242-1ea8-4002-ae85-5e323103ac54" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentInterestRateEffectivePercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_DebtInstrumentInterestRateEffectivePercentage_b87db242-1ea8-4002-ae85-5e323103ac54" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfDebtDiscountPremium_d7abdf5f-9675-4f36-8339-54ebc82e8fe0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationOfDebtDiscountPremium"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_e228af90-77ab-44a9-9af4-6dc269373302" xlink:to="loc_us-gaap_AmortizationOfDebtDiscountPremium_d7abdf5f-9675-4f36-8339-54ebc82e8fe0" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsScheduleofBorrowingsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BorrowingsandOtherObligationsScheduleofBorrowingsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BorrowingsandOtherObligationsScheduleofBorrowingsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_a4dae26f-9c52-4187-9144-39ab6490fce7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_us-gaap_DebtInstrumentTable_a4dae26f-9c52-4187-9144-39ab6490fce7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeAxis_5a71b544-349f-4fd0-bd37-a97e9d489359" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_a4dae26f-9c52-4187-9144-39ab6490fce7" xlink:to="loc_us-gaap_ShortTermDebtTypeAxis_5a71b544-349f-4fd0-bd37-a97e9d489359" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_5a71b544-349f-4fd0-bd37-a97e9d489359_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_5a71b544-349f-4fd0-bd37-a97e9d489359" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_5a71b544-349f-4fd0-bd37-a97e9d489359_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShortTermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortTermDebtTypeAxis_5a71b544-349f-4fd0-bd37-a97e9d489359" xlink:to="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanBankBorrowingsMember_a56aef3f-f8cd-4c49-93ae-d7e195ac9595" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanBankBorrowingsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:to="loc_us-gaap_FederalHomeLoanBankBorrowingsMember_a56aef3f-f8cd-4c49-93ae-d7e195ac9595" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanBankAdvancesMember_51c726ae-fb1a-4f7a-9bb2-8944fd479377" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanBankAdvancesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:to="loc_us-gaap_FederalHomeLoanBankAdvancesMember_51c726ae-fb1a-4f7a-9bb2-8944fd479377" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalFundsLinesOfCreditMember_6fefd750-4b85-4497-98fe-9bfb8cea7020" xlink:href="bmrc-20231231.xsd#bmrc_FederalFundsLinesOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:to="loc_bmrc_FederalFundsLinesOfCreditMember_6fefd750-4b85-4497-98fe-9bfb8cea7020" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_FederalReserveBankTermFundingProgramMember_13374c88-9e2d-4678-b7db-b85d70f5d4dc" xlink:href="bmrc-20231231.xsd#bmrc_FederalReserveBankTermFundingProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortTermDebtTypeDomain_e783e6e9-9193-4dc1-977b-bbf7ddc7d3a3" xlink:to="loc_bmrc_FederalReserveBankTermFundingProgramMember_13374c88-9e2d-4678-b7db-b85d70f5d4dc" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_a4dae26f-9c52-4187-9144-39ab6490fce7" xlink:to="loc_us-gaap_CreditFacilityAxis_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8" xlink:to="loc_us-gaap_CreditFacilityDomain_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_a5a26584-d760-4ecc-8610-4313720ffe1b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_3cb3b689-d09b-4dad-932d-0fbbb7e1ebd8" xlink:to="loc_us-gaap_CreditFacilityDomain_a5a26584-d760-4ecc-8610-4313720ffe1b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditMember_cb3f4a7f-d0bf-44c2-ad46-93452cecd5ab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_a5a26584-d760-4ecc-8610-4313720ffe1b" xlink:to="loc_us-gaap_LineOfCreditMember_cb3f4a7f-d0bf-44c2-ad46-93452cecd5ab" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_55958664-8dab-4660-967f-70d7a45d6f7e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_a4dae26f-9c52-4187-9144-39ab6490fce7" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_55958664-8dab-4660-967f-70d7a45d6f7e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_55958664-8dab-4660-967f-70d7a45d6f7e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_55958664-8dab-4660-967f-70d7a45d6f7e" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_55958664-8dab-4660-967f-70d7a45d6f7e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_45241bd1-aff4-4b4e-bad2-3eab9718d459" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_55958664-8dab-4660-967f-70d7a45d6f7e" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_45241bd1-aff4-4b4e-bad2-3eab9718d459" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherDebtSecuritiesMember_f8d49798-9ece-449c-a419-bcf00048075d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_45241bd1-aff4-4b4e-bad2-3eab9718d459" xlink:to="loc_us-gaap_OtherDebtSecuritiesMember_f8d49798-9ece-449c-a419-bcf00048075d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCredit_438a02ff-6b66-40ee-b756-29737c1de11e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_us-gaap_LineOfCredit_438a02ff-6b66-40ee-b756-29737c1de11e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityAverageOutstandingAmount_457c77f9-3f3f-4607-869e-8b5ecb56c490" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityAverageOutstandingAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_us-gaap_LineOfCreditFacilityAverageOutstandingAmount_457c77f9-3f3f-4607-869e-8b5ecb56c490" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtWeightedAverageInterestRate_917e422a-81a1-41d6-8f61-ab495aca3586" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtWeightedAverageInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_us-gaap_DebtWeightedAverageInterestRate_917e422a-81a1-41d6-8f61-ab495aca3586" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherObligationsCarryingValue_cc72c793-e444-4484-bc06-c532a2e8a32d" xlink:href="bmrc-20231231.xsd#bmrc_OtherObligationsCarryingValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_bmrc_OtherObligationsCarryingValue_cc72c793-e444-4484-bc06-c532a2e8a32d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OtherObligationsAverageBalance_15377af9-b37e-4be6-90c9-1e38617f0a9e" xlink:href="bmrc-20231231.xsd#bmrc_OtherObligationsAverageBalance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_bmrc_OtherObligationsAverageBalance_15377af9-b37e-4be6-90c9-1e38617f0a9e" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BorrowingsAndOtherObligations_d8c863ae-1cca-4fb0-b4cb-b237ea3130d4" xlink:href="bmrc-20231231.xsd#bmrc_BorrowingsAndOtherObligations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_bmrc_BorrowingsAndOtherObligations_d8c863ae-1cca-4fb0-b4cb-b237ea3130d4" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BorrowingsAndOtherObligationsAverageBalance_696aaaf7-79f3-4d25-9b4e-3d2f37f04a6d" xlink:href="bmrc-20231231.xsd#bmrc_BorrowingsAndOtherObligationsAverageBalance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_bmrc_BorrowingsAndOtherObligationsAverageBalance_696aaaf7-79f3-4d25-9b4e-3d2f37f04a6d" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BorrowingsAndOtherObligationsAverageRate_10557069-5684-4a8e-bf62-17cea1a1717d" xlink:href="bmrc-20231231.xsd#bmrc_BorrowingsAndOtherObligationsAverageRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_03fbcf61-4f98-414b-9e02-86aece8c82d7" xlink:to="loc_bmrc_BorrowingsAndOtherObligationsAverageRate_10557069-5684-4a8e-bf62-17cea1a1717d" xlink:type="arc" order="7"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#StockholdersEquityandStockPlansNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_5233f9bc-f6cb-46bb-b804-2c61325ff222" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_5233f9bc-f6cb-46bb-b804-2c61325ff222" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_5233f9bc-f6cb-46bb-b804-2c61325ff222_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_5233f9bc-f6cb-46bb-b804-2c61325ff222" xlink:to="loc_us-gaap_EquityComponentDomain_5233f9bc-f6cb-46bb-b804-2c61325ff222_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_5c7ec0f7-9ca9-4392-9c55-10889f1ac13a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_5233f9bc-f6cb-46bb-b804-2c61325ff222" xlink:to="loc_us-gaap_EquityComponentDomain_5c7ec0f7-9ca9-4392-9c55-10889f1ac13a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_6b93da2b-c3cf-4dba-989a-a080e81f687d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_5c7ec0f7-9ca9-4392-9c55-10889f1ac13a" xlink:to="loc_us-gaap_CommonStockMember_6b93da2b-c3cf-4dba-989a-a080e81f687d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementClassOfStockAxis_c792a26a-a8aa-449c-8d97-1078834747f8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementClassOfStockAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_StatementClassOfStockAxis_c792a26a-a8aa-449c-8d97-1078834747f8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_c792a26a-a8aa-449c-8d97-1078834747f8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c792a26a-a8aa-449c-8d97-1078834747f8" xlink:to="loc_us-gaap_ClassOfStockDomain_c792a26a-a8aa-449c-8d97-1078834747f8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfStockDomain_7d0bed65-d5d9-45f4-8f58-d5efb868dcff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfStockDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_c792a26a-a8aa-449c-8d97-1078834747f8" xlink:to="loc_us-gaap_ClassOfStockDomain_7d0bed65-d5d9-45f4-8f58-d5efb868dcff" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_f58df9c4-deff-44f5-96dc-ace90bc625aa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_7d0bed65-d5d9-45f4-8f58-d5efb868dcff" xlink:to="loc_us-gaap_CommonStockMember_f58df9c4-deff-44f5-96dc-ace90bc625aa" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameAxis_3224dacb-97d3-4c22-9a94-091252b0063f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_PlanNameAxis_3224dacb-97d3-4c22-9a94-091252b0063f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_3224dacb-97d3-4c22-9a94-091252b0063f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PlanNameAxis_3224dacb-97d3-4c22-9a94-091252b0063f" xlink:to="loc_us-gaap_PlanNameDomain_3224dacb-97d3-4c22-9a94-091252b0063f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_8e9d816b-c60d-4bf4-bc98-fb7d5e9c682b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PlanNameAxis_3224dacb-97d3-4c22-9a94-091252b0063f" xlink:to="loc_us-gaap_PlanNameDomain_8e9d816b-c60d-4bf4-bc98-fb7d5e9c682b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ThePlan2020Member_6ee979fb-ecd4-42ab-95d5-b779911c4622" xlink:href="bmrc-20231231.xsd#bmrc_ThePlan2020Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_8e9d816b-c60d-4bf4-bc98-fb7d5e9c682b" xlink:to="loc_bmrc_ThePlan2020Member_6ee979fb-ecd4-42ab-95d5-b779911c4622" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_EmployeeStockPurchasePlan2007Member_09e919e8-e6cf-410c-80e7-bc0d9a083386" xlink:href="bmrc-20231231.xsd#bmrc_EmployeeStockPurchasePlan2007Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_8e9d816b-c60d-4bf4-bc98-fb7d5e9c682b" xlink:to="loc_bmrc_EmployeeStockPurchasePlan2007Member_09e919e8-e6cf-410c-80e7-bc0d9a083386" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_The2017EquityPlanMember_2276452d-05e7-40cf-a21c-cf8bdbf81d7d" xlink:href="bmrc-20231231.xsd#bmrc_The2017EquityPlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_8e9d816b-c60d-4bf4-bc98-fb7d5e9c682b" xlink:to="loc_bmrc_The2017EquityPlanMember_2276452d-05e7-40cf-a21c-cf8bdbf81d7d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_2794f18f-9c6d-4365-9bce-79c3d60b53d6" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_srt_RangeAxis_2794f18f-9c6d-4365-9bce-79c3d60b53d6" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_2794f18f-9c6d-4365-9bce-79c3d60b53d6_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_2794f18f-9c6d-4365-9bce-79c3d60b53d6" xlink:to="loc_srt_RangeMember_2794f18f-9c6d-4365-9bce-79c3d60b53d6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_29239c51-2c83-4bac-ae82-e4d197506782" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_2794f18f-9c6d-4365-9bce-79c3d60b53d6" xlink:to="loc_srt_RangeMember_29239c51-2c83-4bac-ae82-e4d197506782" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_3c9883b9-6368-4b56-b6f3-543784e4113a" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_29239c51-2c83-4bac-ae82-e4d197506782" xlink:to="loc_srt_MinimumMember_3c9883b9-6368-4b56-b6f3-543784e4113a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_f7ffc87a-d700-4c3b-9cc2-040052cf05b2" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_29239c51-2c83-4bac-ae82-e4d197506782" xlink:to="loc_srt_MaximumMember_f7ffc87a-d700-4c3b-9cc2-040052cf05b2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_5ea61ebb-0cec-4734-b29a-0615550a7e09" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_AwardTypeAxis_5ea61ebb-0cec-4734-b29a-0615550a7e09" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_5ea61ebb-0cec-4734-b29a-0615550a7e09_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_5ea61ebb-0cec-4734-b29a-0615550a7e09" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_5ea61ebb-0cec-4734-b29a-0615550a7e09_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_dd579293-6755-4f07-8594-e98b54107663" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_5ea61ebb-0cec-4734-b29a-0615550a7e09" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_dd579293-6755-4f07-8594-e98b54107663" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_ade54422-75a8-4941-b6b9-2e6048042fb4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_dd579293-6755-4f07-8594-e98b54107663" xlink:to="loc_us-gaap_EmployeeStockOptionMember_ade54422-75a8-4941-b6b9-2e6048042fb4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PerformanceSharesMember_3c9b5e7b-3417-4968-8617-81f16a0e3e6f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PerformanceSharesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_dd579293-6755-4f07-8594-e98b54107663" xlink:to="loc_us-gaap_PerformanceSharesMember_3c9b5e7b-3417-4968-8617-81f16a0e3e6f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockMember_5cab32c8-ddca-409c-bc37-ac140c193268" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_dd579293-6755-4f07-8594-e98b54107663" xlink:to="loc_us-gaap_RestrictedStockMember_5cab32c8-ddca-409c-bc37-ac140c193268" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualAxis_456f63cd-576c-48de-b087-c8135f0f3321" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_srt_TitleOfIndividualAxis_456f63cd-576c-48de-b087-c8135f0f3321" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_456f63cd-576c-48de-b087-c8135f0f3321_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_TitleOfIndividualAxis_456f63cd-576c-48de-b087-c8135f0f3321" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_456f63cd-576c-48de-b087-c8135f0f3321_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_4481b574-ba67-4c54-8fff-ed6e85e4b385" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_TitleOfIndividualAxis_456f63cd-576c-48de-b087-c8135f0f3321" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_4481b574-ba67-4c54-8fff-ed6e85e4b385" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OfficersAndEmployeesMember_d114f695-48ba-42f0-9c55-7dd4d8edbc45" xlink:href="bmrc-20231231.xsd#bmrc_OfficersAndEmployeesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_4481b574-ba67-4c54-8fff-ed6e85e4b385" xlink:to="loc_bmrc_OfficersAndEmployeesMember_d114f695-48ba-42f0-9c55-7dd4d8edbc45" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_NonEmployeeDirectorsMember_59da6c84-f488-4300-b5cb-8e595438b698" xlink:href="bmrc-20231231.xsd#bmrc_NonEmployeeDirectorsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_4481b574-ba67-4c54-8fff-ed6e85e4b385" xlink:to="loc_bmrc_NonEmployeeDirectorsMember_59da6c84-f488-4300-b5cb-8e595438b698" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeAxis_347019c7-5b88-4815-949f-102819b788b7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_SubsequentEventTypeAxis_347019c7-5b88-4815-949f-102819b788b7" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_347019c7-5b88-4815-949f-102819b788b7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_347019c7-5b88-4815-949f-102819b788b7" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_347019c7-5b88-4815-949f-102819b788b7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventTypeDomain_db028839-8a47-4ba1-8fe1-8defa880fe85" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsequentEventTypeAxis_347019c7-5b88-4815-949f-102819b788b7" xlink:to="loc_us-gaap_SubsequentEventTypeDomain_db028839-8a47-4ba1-8fe1-8defa880fe85" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SubsequentEventMember_9a9c4cfa-dbb7-45c1-b910-00c510e64531" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SubsequentEventMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SubsequentEventTypeDomain_db028839-8a47-4ba1-8fe1-8defa880fe85" xlink:to="loc_us-gaap_SubsequentEventMember_9a9c4cfa-dbb7-45c1-b910-00c510e64531" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingAxis_e2b93d8c-c1be-4c37-909b-bea42fbe75b0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_5a3366a2-fd46-4a75-a2b9-cbb003f1f1cd" xlink:to="loc_us-gaap_VestingAxis_e2b93d8c-c1be-4c37-909b-bea42fbe75b0" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingDomain_e2b93d8c-c1be-4c37-909b-bea42fbe75b0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VestingAxis_e2b93d8c-c1be-4c37-909b-bea42fbe75b0" xlink:to="loc_us-gaap_VestingDomain_e2b93d8c-c1be-4c37-909b-bea42fbe75b0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingDomain_5c9744e2-6b6c-4df7-82fe-e91272f44162" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VestingAxis_e2b93d8c-c1be-4c37-909b-bea42fbe75b0" xlink:to="loc_us-gaap_VestingDomain_5c9744e2-6b6c-4df7-82fe-e91272f44162" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheOneMember_66073277-74bc-456f-887b-02adbe5fb4e7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5c9744e2-6b6c-4df7-82fe-e91272f44162" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheOneMember_66073277-74bc-456f-887b-02adbe5fb4e7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheTwoMember_2f5dea82-438c-4fc3-a266-a523ede15b60" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheTwoMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5c9744e2-6b6c-4df7-82fe-e91272f44162" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheTwoMember_2f5dea82-438c-4fc3-a266-a523ede15b60" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheThreeMember_01f5a17e-8429-49ea-880f-cd25f7e6884f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheThreeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5c9744e2-6b6c-4df7-82fe-e91272f44162" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheThreeMember_01f5a17e-8429-49ea-880f-cd25f7e6884f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_5b9c9516-17b6-43d0-8369-4be0855811db" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_5b9c9516-17b6-43d0-8369-4be0855811db" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_ff344e02-7747-460e-ad21-859feafcaecf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardSharesIssuedInPeriod_ff344e02-7747-460e-ad21-859feafcaecf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_dbc66cce-88bd-4c91-995c-33decc0a9fa2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAvailableForGrant_dbc66cce-88bd-4c91-995c-33decc0a9fa2" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardApprovedPayrollDeductionToPurchaseSharesPercentage_15f3630e-8f17-4ee3-8277-d2b02cef1265" xlink:href="bmrc-20231231.xsd#bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardApprovedPayrollDeductionToPurchaseSharesPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_bmrc_ShareBasedCompensationArrangementByShareBasedPaymentAwardApprovedPayrollDeductionToPurchaseSharesPercentage_15f3630e-8f17-4ee3-8277-d2b02cef1265" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardDiscountFromMarketPricePurchaseDate_0444d372-be1e-4a12-bdb2-1ef43ce09e4b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardDiscountFromMarketPricePurchaseDate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardDiscountFromMarketPricePurchaseDate_0444d372-be1e-4a12-bdb2-1ef43ce09e4b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentage_d9177de4-b06d-46fd-ba3e-dc81b1e50250" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardAwardVestingRightsPercentage_d9177de4-b06d-46fd-ba3e-dc81b1e50250" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_6f284900-857e-4b21-ad49-40785bf50429" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_6f284900-857e-4b21-ad49-40785bf50429" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_78aeb76e-6bf6-4761-9b21-6544c62a66b9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_78aeb76e-6bf6-4761-9b21-6544c62a66b9" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllocatedShareBasedCompensationExpense_bdb6dc95-37b8-4e91-9fcb-ad300c74a88c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AllocatedShareBasedCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_AllocatedShareBasedCompensationExpense_bdb6dc95-37b8-4e91-9fcb-ad300c74a88c" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_878479ff-53f1-4ae5-b5f4-dcd4cfe466e2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_878479ff-53f1-4ae5-b5f4-dcd4cfe466e2" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_33454259-f78c-4b2b-87aa-c787d635583d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_33454259-f78c-4b2b-87aa-c787d635583d" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_b1ff8157-778b-43ff-83e8-29edf48b9b56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_b1ff8157-778b-43ff-83e8-29edf48b9b56" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1_ee517b64-c5b6-48f4-a055-e1702647f397" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedInPeriodFairValue1_ee517b64-c5b6-48f4-a055-e1702647f397" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_bdcf3c97-4b6e-4662-95e9-9912f222cddc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationShareBasedCompensationExcessTaxBenefitAmount_bdcf3c97-4b6e-4662-95e9-9912f222cddc" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockDividendsPerShareDeclared_9ca3302c-88c2-458c-bfa9-c71aa7e59c84" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockDividendsPerShareDeclared"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1d2e8c1d-52bb-4e05-a0c6-3883f655100c" xlink:to="loc_us-gaap_CommonStockDividendsPerShareDeclared_9ca3302c-88c2-458c-bfa9-c71aa7e59c84" xlink:type="arc" order="14"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofOptionsOutstandingbyPriceRangeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#StockholdersEquityandStockPlansScheduleofOptionsOutstandingbyPriceRangeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofOptionsOutstandingbyPriceRangeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_bddb3231-a5d1-436b-b92c-bcfb8cdb9fc5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_bddb3231-a5d1-436b-b92c-bcfb8cdb9fc5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_db6a946d-0109-432a-baa8-ac38a6c8398c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_bddb3231-a5d1-436b-b92c-bcfb8cdb9fc5" xlink:to="loc_us-gaap_AwardTypeAxis_db6a946d-0109-432a-baa8-ac38a6c8398c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_db6a946d-0109-432a-baa8-ac38a6c8398c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_db6a946d-0109-432a-baa8-ac38a6c8398c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_db6a946d-0109-432a-baa8-ac38a6c8398c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d19c12e3-fba3-4ecb-81bc-0f273717cc5e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_db6a946d-0109-432a-baa8-ac38a6c8398c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d19c12e3-fba3-4ecb-81bc-0f273717cc5e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_3e2d37e3-a35b-4312-89ba-8c8f3a775926" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d19c12e3-fba3-4ecb-81bc-0f273717cc5e" xlink:to="loc_us-gaap_EmployeeStockOptionMember_3e2d37e3-a35b-4312-89ba-8c8f3a775926" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_1ecc3c68-ba10-44a6-a647-b59d19b1eb35" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_bddb3231-a5d1-436b-b92c-bcfb8cdb9fc5" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_1ecc3c68-ba10-44a6-a647-b59d19b1eb35" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_1ecc3c68-ba10-44a6-a647-b59d19b1eb35_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_1ecc3c68-ba10-44a6-a647-b59d19b1eb35" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_1ecc3c68-ba10-44a6-a647-b59d19b1eb35_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansByExercisePriceRangeAxis_1ecc3c68-ba10-44a6-a647-b59d19b1eb35" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PriceRangeOneMember_b3a8f133-16bd-4531-8554-667ded1c64cb" xlink:href="bmrc-20231231.xsd#bmrc_PriceRangeOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:to="loc_bmrc_PriceRangeOneMember_b3a8f133-16bd-4531-8554-667ded1c64cb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PriceRangeTwoMember_6d63bc4c-2b4a-4c0b-8c1b-3cd224e396e9" xlink:href="bmrc-20231231.xsd#bmrc_PriceRangeTwoMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:to="loc_bmrc_PriceRangeTwoMember_6d63bc4c-2b4a-4c0b-8c1b-3cd224e396e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PriceRangeThreeMember_a53e6c1b-1076-49ba-b4d2-08cf0f5a1d14" xlink:href="bmrc-20231231.xsd#bmrc_PriceRangeThreeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:to="loc_bmrc_PriceRangeThreeMember_a53e6c1b-1076-49ba-b4d2-08cf0f5a1d14" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_PriceRangeFourMember_26257419-76aa-405a-9b2c-9f4018f06f19" xlink:href="bmrc-20231231.xsd#bmrc_PriceRangeFourMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeDomain_60384c56-ca95-4404-bf1e-d941782070f8" xlink:to="loc_bmrc_PriceRangeFourMember_26257419-76aa-405a-9b2c-9f4018f06f19" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit_e1624942-236d-4823-acab-b4177c3bdcec" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeLowerRangeLimit_e1624942-236d-4823-acab-b4177c3bdcec" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit_d097df18-9e1d-49cc-b168-24a28a6813fb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationSharesAuthorizedUnderStockOptionPlansExercisePriceRangeUpperRangeLimit_d097df18-9e1d-49cc-b168-24a28a6813fb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_9974164a-7653-4af6-9ef7-6dc782ddc076" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumber_9974164a-7653-4af6-9ef7-6dc782ddc076" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_c33ab7f5-15d1-44e4-8bb3-f537bfa3fd50" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsOutstandingWeightedAverageRemainingContractualTerm2_c33ab7f5-15d1-44e4-8bb3-f537bfa3fd50" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_cea87adc-039b-4064-8f5a-0783fa378a1a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingWeightedAverageExercisePrice_cea87adc-039b-4064-8f5a-0783fa378a1a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_3c51a210-a046-4361-9ba3-3368eaea75aa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableNumber_3c51a210-a046-4361-9ba3-3368eaea75aa" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_783a7d68-99ef-4b4c-85e2-90b8480df3d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_cc134559-a050-46c2-ab8e-7f28e8a825e9" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisableWeightedAverageExercisePrice_783a7d68-99ef-4b4c-85e2-90b8480df3d8" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofNonvestedAwardsActivityDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#StockholdersEquityandStockPlansScheduleofNonvestedAwardsActivityDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofNonvestedAwardsActivityDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_2b3b5419-02b1-40da-94f3-e1f9d1a4361d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_d027a2c4-1259-4290-943a-4a69cc034503" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_2b3b5419-02b1-40da-94f3-e1f9d1a4361d" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_d027a2c4-1259-4290-943a-4a69cc034503" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_d027a2c4-1259-4290-943a-4a69cc034503" xlink:to="loc_us-gaap_AwardTypeAxis_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_398c899d-1eb9-48f7-a008-2de03f934c85" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_d5afbeaa-ba7e-494c-88d5-f6c0d4dcd680" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_398c899d-1eb9-48f7-a008-2de03f934c85" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockMember_725d9584-4dc5-4b97-bcd2-0757a50f2e0f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_398c899d-1eb9-48f7-a008-2de03f934c85" xlink:to="loc_us-gaap_RestrictedStockMember_725d9584-4dc5-4b97-bcd2-0757a50f2e0f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_2b3b5419-02b1-40da-94f3-e1f9d1a4361d" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_37d7917b-7791-4352-9cd6-d034acfa8447" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_37d7917b-7791-4352-9cd6-d034acfa8447" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_abeb81a3-d64b-46d9-ab20-d48cd4bfe22d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_abeb81a3-d64b-46d9-ab20-d48cd4bfe22d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_b73c2bd0-7ffa-4acd-bfa1-c033d6e84dd2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_b73c2bd0-7ffa-4acd-bfa1-c033d6e84dd2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_9027862c-49d1-4369-a270-1e791903d7f0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_6ab28d2b-41fc-43aa-ada6-55d2f53992f6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_9027862c-49d1-4369-a270-1e791903d7f0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_40d3bfbd-b461-4af9-afbb-5768fcd3e261" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_2b3b5419-02b1-40da-94f3-e1f9d1a4361d" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_bfb92976-d6a5-4f4f-b921-99bb06a35296" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_bfb92976-d6a5-4f4f-b921-99bb06a35296" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_5da7d357-1a65-462d-a3bb-16dd7aa5b866" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_5da7d357-1a65-462d-a3bb-16dd7aa5b866" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_12791ca1-9c46-4874-ad42-a35fb3bf2a98" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_12791ca1-9c46-4874-ad42-a35fb3bf2a98" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_74686630-206e-411e-a7b6-7e3ae14cc31a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_ccc2f6b6-9fb0-4a62-95da-dc7975a6beab" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_74686630-206e-411e-a7b6-7e3ae14cc31a" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_627d7193-d6a2-4db6-9e96-b08c2436ff6f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofValuationAssumptionsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#StockholdersEquityandStockPlansScheduleofValuationAssumptionsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofValuationAssumptionsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_165fd9ed-6253-41ad-80df-d5b8fee8fba1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_165fd9ed-6253-41ad-80df-d5b8fee8fba1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_d0eb3c28-ad72-45b9-b35d-009dea70200e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_165fd9ed-6253-41ad-80df-d5b8fee8fba1" xlink:to="loc_us-gaap_AwardTypeAxis_d0eb3c28-ad72-45b9-b35d-009dea70200e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d0eb3c28-ad72-45b9-b35d-009dea70200e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_d0eb3c28-ad72-45b9-b35d-009dea70200e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_d0eb3c28-ad72-45b9-b35d-009dea70200e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_2f5797f9-19e0-4a3c-baaa-f6c507c2cd7b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_d0eb3c28-ad72-45b9-b35d-009dea70200e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_2f5797f9-19e0-4a3c-baaa-f6c507c2cd7b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_904626ea-e93d-4d0f-8dc8-bea81e937112" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_2f5797f9-19e0-4a3c-baaa-f6c507c2cd7b" xlink:to="loc_us-gaap_EmployeeStockOptionMember_904626ea-e93d-4d0f-8dc8-bea81e937112" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_1033273f-5cc9-4574-8ce9-483bbc0974b2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_1033273f-5cc9-4574-8ce9-483bbc0974b2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_335e5d4b-6a59-4015-880b-b82b24e3e295" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_335e5d4b-6a59-4015-880b-b82b24e3e295" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_ab1ef9b5-ff2c-488e-a3c9-8f453a809194" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_ab1ef9b5-ff2c-488e-a3c9-8f453a809194" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_a1ce628c-8df6-405b-b510-503e7a73d836" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_fc099483-4690-41c6-be6b-2737965b8b32" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_a1ce628c-8df6-405b-b510-503e7a73d836" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofShareRepurchasesDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#StockholdersEquityandStockPlansScheduleofShareRepurchasesDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/StockholdersEquityandStockPlansScheduleofShareRepurchasesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1e09e918-3b7a-4b0d-895f-6721d05230fd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_fd617a02-21c7-4f4c-96c6-63dd41a9b732" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1e09e918-3b7a-4b0d-895f-6721d05230fd" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_fd617a02-21c7-4f4c-96c6-63dd41a9b732" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_f1a34921-0783-4ab9-88a8-f0392834754e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_fd617a02-21c7-4f4c-96c6-63dd41a9b732" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_f1a34921-0783-4ab9-88a8-f0392834754e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_f1a34921-0783-4ab9-88a8-f0392834754e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_f1a34921-0783-4ab9-88a8-f0392834754e" xlink:to="loc_us-gaap_EquityComponentDomain_f1a34921-0783-4ab9-88a8-f0392834754e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_7165809e-f56d-4487-93cc-537d40af2ba4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_f1a34921-0783-4ab9-88a8-f0392834754e" xlink:to="loc_us-gaap_EquityComponentDomain_7165809e-f56d-4487-93cc-537d40af2ba4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_df3a5de3-1b7d-4020-9a90-e28a501235fc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_7165809e-f56d-4487-93cc-537d40af2ba4" xlink:to="loc_us-gaap_CommonStockMember_df3a5de3-1b7d-4020-9a90-e28a501235fc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_adfc3749-8869-4408-966f-4803aeae2b15" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockRepurchaseProgramAuthorizedAmount1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1e09e918-3b7a-4b0d-895f-6721d05230fd" xlink:to="loc_us-gaap_StockRepurchaseProgramAuthorizedAmount1_adfc3749-8869-4408-966f-4803aeae2b15" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodShares_14d4c2aa-ce49-470f-b887-6a9f95fc88c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockRepurchasedDuringPeriodShares"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1e09e918-3b7a-4b0d-895f-6721d05230fd" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodShares_14d4c2aa-ce49-470f-b887-6a9f95fc88c4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockRepurchasedDuringPeriodValue_d7b1ee92-7a69-494e-abe6-f222b8c0568f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockRepurchasedDuringPeriodValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1e09e918-3b7a-4b0d-895f-6721d05230fd" xlink:to="loc_us-gaap_StockRepurchasedDuringPeriodValue_d7b1ee92-7a69-494e-abe6-f222b8c0568f" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofRecordedonaRecurringBasisDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#FairValueofAssetsandLiabilitiesScheduleofRecordedonaRecurringBasisDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofRecordedonaRecurringBasisDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b614857d-bb41-4fcc-b6d0-004f635497cc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b614857d-bb41-4fcc-b6d0-004f635497cc" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementBasisAxis_2d1b48eb-a953-4b24-bda1-182c813c4a5e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementBasisAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:to="loc_us-gaap_FairValueByMeasurementBasisAxis_2d1b48eb-a953-4b24-bda1-182c813c4a5e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_2d1b48eb-a953-4b24-bda1-182c813c4a5e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_2d1b48eb-a953-4b24-bda1-182c813c4a5e" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_2d1b48eb-a953-4b24-bda1-182c813c4a5e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueDisclosureItemAmountsDomain_f932551c-1e25-447b-a72b-97f79f4c16ae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueDisclosureItemAmountsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_2d1b48eb-a953-4b24-bda1-182c813c4a5e" xlink:to="loc_us-gaap_FairValueDisclosureItemAmountsDomain_f932551c-1e25-447b-a72b-97f79f4c16ae" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ab045446-562c-4bdf-82c9-b30816cfd4a3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueDisclosureItemAmountsDomain_f932551c-1e25-447b-a72b-97f79f4c16ae" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ab045446-562c-4bdf-82c9-b30816cfd4a3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_34b2a272-b22c-4d44-89c3-a632cd558c05" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CarryingReportedAmountFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ab045446-562c-4bdf-82c9-b30816cfd4a3" xlink:to="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_34b2a272-b22c-4d44-89c3-a632cd558c05" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_c3a5ccda-bf02-491f-82a7-f83a8947f31e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EstimateOfFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ab045446-562c-4bdf-82c9-b30816cfd4a3" xlink:to="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_c3a5ccda-bf02-491f-82a7-f83a8947f31e" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_3510eb39-94d2-43d1-b028-2c9ff8cbd135" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_3510eb39-94d2-43d1-b028-2c9ff8cbd135" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_3510eb39-94d2-43d1-b028-2c9ff8cbd135_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_3510eb39-94d2-43d1-b028-2c9ff8cbd135" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_3510eb39-94d2-43d1-b028-2c9ff8cbd135_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_08689403-a4b4-4931-8c8f-3cde1a312445" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_3510eb39-94d2-43d1-b028-2c9ff8cbd135" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_08689403-a4b4-4931-8c8f-3cde1a312445" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_6d54d0e0-1e75-46b1-84b6-c1fc6be4cb1f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_08689403-a4b4-4931-8c8f-3cde1a312445" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_6d54d0e0-1e75-46b1-84b6-c1fc6be4cb1f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_c76b3d9a-d187-4df7-922b-fcd43a978dcd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:to="loc_us-gaap_FinancialInstrumentAxis_c76b3d9a-d187-4df7-922b-fcd43a978dcd" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c76b3d9a-d187-4df7-922b-fcd43a978dcd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_c76b3d9a-d187-4df7-922b-fcd43a978dcd" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c76b3d9a-d187-4df7-922b-fcd43a978dcd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_c76b3d9a-d187-4df7-922b-fcd43a978dcd" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesMember_84f65f2b-8cfd-4197-aaa5-396b70eb0a12" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_MortgageBackedSecuritiesMember_84f65f2b-8cfd-4197-aaa5-396b70eb0a12" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_ca1cc099-10ab-43b2-8534-a3d483bfab99" xlink:href="bmrc-20231231.xsd#bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_bmrc_SmallBusinessAdministrationSBABackedSecuritiesMember_ca1cc099-10ab-43b2-8534-a3d483bfab99" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_b8ec21a4-3aed-47b0-953a-273d64f20291" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_USGovernmentSponsoredEnterprisesDebtSecuritiesMember_b8ec21a4-3aed-47b0-953a-273d64f20291" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_f20683d9-8ef2-4d42-8a39-e27be9671571" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_f20683d9-8ef2-4d42-8a39-e27be9671571" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_19cf7274-0c5f-4e4c-9791-5800effbfa25" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_19cf7274-0c5f-4e4c-9791-5800effbfa25" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CorporateBondSecuritiesMember_13b8098a-5aef-4d1a-9510-392112fa4d36" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CorporateBondSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_CorporateBondSecuritiesMember_13b8098a-5aef-4d1a-9510-392112fa4d36" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_cfebeb34-0fe8-4aba-97e6-ddd76e5b3693" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AssetBackedSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_cfebeb34-0fe8-4aba-97e6-ddd76e5b3693" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestRateContractsMember_00ad60db-da64-4113-93e5-ffbaee442695" xlink:href="bmrc-20231231.xsd#bmrc_InterestRateContractsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_6ca372d0-6892-4dc4-9339-02fa6dc173f3" xlink:to="loc_bmrc_InterestRateContractsMember_00ad60db-da64-4113-93e5-ffbaee442695" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_311ffdaf-c67b-4809-9078-4a07fa7d6aab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_052d6810-52ee-41b2-a79c-47bce66784a1" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_311ffdaf-c67b-4809-9078-4a07fa7d6aab" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_311ffdaf-c67b-4809-9078-4a07fa7d6aab_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_311ffdaf-c67b-4809-9078-4a07fa7d6aab" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_311ffdaf-c67b-4809-9078-4a07fa7d6aab_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_114459e0-052f-42c6-bb00-51de297751bd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_311ffdaf-c67b-4809-9078-4a07fa7d6aab" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_114459e0-052f-42c6-bb00-51de297751bd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_919af276-f71a-4dbc-9d14-402ccdb23334" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_114459e0-052f-42c6-bb00-51de297751bd" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_919af276-f71a-4dbc-9d14-402ccdb23334" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_227767d2-f4a3-4636-a4cb-fc3601ddea08" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_114459e0-052f-42c6-bb00-51de297751bd" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_227767d2-f4a3-4636-a4cb-fc3601ddea08" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_c41fa975-b688-4f16-9af3-d383a2b2f3b8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_114459e0-052f-42c6-bb00-51de297751bd" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_c41fa975-b688-4f16-9af3-d383a2b2f3b8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_a1a420b3-7e40-42cc-a8d8-088e3b7930f6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b614857d-bb41-4fcc-b6d0-004f635497cc" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_a1a420b3-7e40-42cc-a8d8-088e3b7930f6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_935a0c06-8147-41b7-a29e-0792c5a1cd8c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b614857d-bb41-4fcc-b6d0-004f635497cc" xlink:to="loc_us-gaap_DerivativeAssets_935a0c06-8147-41b7-a29e-0792c5a1cd8c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_fe4464ec-5591-47f0-9ff2-1a4d85d86ab4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_b614857d-bb41-4fcc-b6d0-004f635497cc" xlink:to="loc_us-gaap_DerivativeLiabilities_fe4464ec-5591-47f0-9ff2-1a4d85d86ab4" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#FairValueofAssetsandLiabilitiesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8876df46-f5c7-4894-8e43-53d8a312a337" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_9bacab0f-039f-4576-8486-6b667aea191f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8876df46-f5c7-4894-8e43-53d8a312a337" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_9bacab0f-039f-4576-8486-6b667aea191f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_75c92581-acad-4bd1-8371-38770b4c2286" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_9bacab0f-039f-4576-8486-6b667aea191f" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_75c92581-acad-4bd1-8371-38770b4c2286" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_75c92581-acad-4bd1-8371-38770b4c2286_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_75c92581-acad-4bd1-8371-38770b4c2286" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_75c92581-acad-4bd1-8371-38770b4c2286_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_dbc64af9-fa38-402f-8eec-2a7b7d097581" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_75c92581-acad-4bd1-8371-38770b4c2286" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_dbc64af9-fa38-402f-8eec-2a7b7d097581" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_2cfda874-6d5f-4e09-a414-c372f41c55a3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_dbc64af9-fa38-402f-8eec-2a7b7d097581" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_2cfda874-6d5f-4e09-a414-c372f41c55a3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MarketableSecuritiesNumberOfSecurities_43ef547e-09f5-401a-bd2b-8b6c4e1f86f7" xlink:href="bmrc-20231231.xsd#bmrc_MarketableSecuritiesNumberOfSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8876df46-f5c7-4894-8e43-53d8a312a337" xlink:to="loc_bmrc_MarketableSecuritiesNumberOfSecurities_43ef547e-09f5-401a-bd2b-8b6c4e1f86f7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossPeriodIncreaseDecrease_f5785b19-a964-439b-acdc-d0803880c391" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossPeriodIncreaseDecrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8876df46-f5c7-4894-8e43-53d8a312a337" xlink:to="loc_us-gaap_DebtSecuritiesHeldToMaturityAllowanceForCreditLossPeriodIncreaseDecrease_f5785b19-a964-439b-acdc-d0803880c391" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofFairValueAssetsMeasuredonNonrecurringBasisDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#FairValueofAssetsandLiabilitiesScheduleofFairValueAssetsMeasuredonNonrecurringBasisDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofFairValueAssetsMeasuredonNonrecurringBasisDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_d3bc1ce9-18d9-458e-a735-8875cc0d9a49" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_d3bc1ce9-18d9-458e-a735-8875cc0d9a49" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_eb35cd8f-cab0-4171-9705-d17e7e3545ed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_c6016e2b-8ee4-4b7f-9ce0-b95a77b852b8" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_eb35cd8f-cab0-4171-9705-d17e7e3545ed" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_1ae170de-41d2-4f4c-a174-69197f2092b9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_eb35cd8f-cab0-4171-9705-d17e7e3545ed" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_1ae170de-41d2-4f4c-a174-69197f2092b9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_99c999bb-01b0-4fda-b623-c141aa16cc4b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_99c999bb-01b0-4fda-b623-c141aa16cc4b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_99c999bb-01b0-4fda-b623-c141aa16cc4b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_99c999bb-01b0-4fda-b623-c141aa16cc4b" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_99c999bb-01b0-4fda-b623-c141aa16cc4b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_90d6120f-12f0-4b1b-8f3a-813e39ea9586" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_99c999bb-01b0-4fda-b623-c141aa16cc4b" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_90d6120f-12f0-4b1b-8f3a-813e39ea9586" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_4086862f-49ad-46ef-8a58-57c511d19d07" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_90d6120f-12f0-4b1b-8f3a-813e39ea9586" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_4086862f-49ad-46ef-8a58-57c511d19d07" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_b1b68455-cd78-4317-9dc4-52d01ecb3cf9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_90d6120f-12f0-4b1b-8f3a-813e39ea9586" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_b1b68455-cd78-4317-9dc4-52d01ecb3cf9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_8bb3bef8-6c19-4fce-bd9d-1d4975a4216c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_90d6120f-12f0-4b1b-8f3a-813e39ea9586" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_8bb3bef8-6c19-4fce-bd9d-1d4975a4216c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_10cbdb5b-ca9a-448b-9532-ff5d23a0675c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:to="loc_us-gaap_FinancialInstrumentAxis_10cbdb5b-ca9a-448b-9532-ff5d23a0675c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_10cbdb5b-ca9a-448b-9532-ff5d23a0675c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_10cbdb5b-ca9a-448b-9532-ff5d23a0675c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_10cbdb5b-ca9a-448b-9532-ff5d23a0675c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35d43177-4ce5-49b5-924c-798da286d2cf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_10cbdb5b-ca9a-448b-9532-ff5d23a0675c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35d43177-4ce5-49b5-924c-798da286d2cf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RealEstateOtherMember_93c5d21c-67bb-467e-aa7c-99718c294e41" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RealEstateOtherMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35d43177-4ce5-49b5-924c-798da286d2cf" xlink:to="loc_us-gaap_RealEstateOtherMember_93c5d21c-67bb-467e-aa7c-99718c294e41" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementBasisAxis_af4903ec-8220-4220-9824-2810d89a404c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementBasisAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_13feb49a-11dc-451c-aa65-e172563afd42" xlink:to="loc_us-gaap_FairValueByMeasurementBasisAxis_af4903ec-8220-4220-9824-2810d89a404c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_af4903ec-8220-4220-9824-2810d89a404c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_af4903ec-8220-4220-9824-2810d89a404c" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_af4903ec-8220-4220-9824-2810d89a404c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueDisclosureItemAmountsDomain_a46f21a5-1d38-4ef6-9185-15e1e2dab16e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueDisclosureItemAmountsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_af4903ec-8220-4220-9824-2810d89a404c" xlink:to="loc_us-gaap_FairValueDisclosureItemAmountsDomain_a46f21a5-1d38-4ef6-9185-15e1e2dab16e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ae67f514-689e-494b-825c-2048c72c02b2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueDisclosureItemAmountsDomain_a46f21a5-1d38-4ef6-9185-15e1e2dab16e" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ae67f514-689e-494b-825c-2048c72c02b2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_619114ae-a376-4331-acef-74936f0cb3de" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CarryingReportedAmountFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ae67f514-689e-494b-825c-2048c72c02b2" xlink:to="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_619114ae-a376-4331-acef-74936f0cb3de" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_966116a7-9e28-4f9d-88f9-4e85c815f77a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EstimateOfFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_ae67f514-689e-494b-825c-2048c72c02b2" xlink:to="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_966116a7-9e28-4f9d-88f9-4e85c815f77a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_0b0f7aac-55b6-47bd-9ecb-3d24b4ffc1d5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_d3bc1ce9-18d9-458e-a735-8875cc0d9a49" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleExcludingAccruedInterest_0b0f7aac-55b6-47bd-9ecb-3d24b4ffc1d5" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofFairValueofFinancialInstrumentsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#FairValueofAssetsandLiabilitiesScheduleofFairValueofFinancialInstrumentsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/FairValueofAssetsandLiabilitiesScheduleofFairValueofFinancialInstrumentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_17f751b9-35ea-489e-af3a-08465e6e6a7d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByBalanceSheetGroupingTable_5388a81d-d295-4775-8b24-ed560e6f506a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByBalanceSheetGroupingTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_17f751b9-35ea-489e-af3a-08465e6e6a7d" xlink:to="loc_us-gaap_FairValueByBalanceSheetGroupingTable_5388a81d-d295-4775-8b24-ed560e6f506a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_04531a7b-afbd-41a5-8390-c27e6ce85003" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_5388a81d-d295-4775-8b24-ed560e6f506a" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_04531a7b-afbd-41a5-8390-c27e6ce85003" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_04531a7b-afbd-41a5-8390-c27e6ce85003_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_04531a7b-afbd-41a5-8390-c27e6ce85003" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_04531a7b-afbd-41a5-8390-c27e6ce85003_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_d5ef4ae4-1047-4178-91bd-1f72c1642d77" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_04531a7b-afbd-41a5-8390-c27e6ce85003" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_d5ef4ae4-1047-4178-91bd-1f72c1642d77" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_ba5dbdd2-f2b4-47b0-8261-b20d3d8c29e4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_d5ef4ae4-1047-4178-91bd-1f72c1642d77" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_ba5dbdd2-f2b4-47b0-8261-b20d3d8c29e4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_500afa14-efbd-469d-b8b0-d2f54ce7f25f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_d5ef4ae4-1047-4178-91bd-1f72c1642d77" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_500afa14-efbd-469d-b8b0-d2f54ce7f25f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_f3fee35c-032d-4db7-86a9-ecd2e25ac909" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_d5ef4ae4-1047-4178-91bd-1f72c1642d77" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_f3fee35c-032d-4db7-86a9-ecd2e25ac909" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementBasisAxis_1e3e3fc6-6673-40e4-b811-435dac19fa59" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementBasisAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueByBalanceSheetGroupingTable_5388a81d-d295-4775-8b24-ed560e6f506a" xlink:to="loc_us-gaap_FairValueByMeasurementBasisAxis_1e3e3fc6-6673-40e4-b811-435dac19fa59" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_1e3e3fc6-6673-40e4-b811-435dac19fa59_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_1e3e3fc6-6673-40e4-b811-435dac19fa59" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_1e3e3fc6-6673-40e4-b811-435dac19fa59_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueDisclosureItemAmountsDomain_6c4779ea-3cd7-4012-95c9-ea54bf86f4ce" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueDisclosureItemAmountsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementBasisAxis_1e3e3fc6-6673-40e4-b811-435dac19fa59" xlink:to="loc_us-gaap_FairValueDisclosureItemAmountsDomain_6c4779ea-3cd7-4012-95c9-ea54bf86f4ce" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_f16826b5-1b22-44ac-bd1e-506062b06271" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PortionAtFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueDisclosureItemAmountsDomain_6c4779ea-3cd7-4012-95c9-ea54bf86f4ce" xlink:to="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_f16826b5-1b22-44ac-bd1e-506062b06271" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_4db47ab1-92d5-494a-9190-4f88cb76835e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CarryingReportedAmountFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_f16826b5-1b22-44ac-bd1e-506062b06271" xlink:to="loc_us-gaap_CarryingReportedAmountFairValueDisclosureMember_4db47ab1-92d5-494a-9190-4f88cb76835e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_26449828-65e4-47df-9d1b-d21ba8a3de04" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EstimateOfFairValueFairValueDisclosureMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PortionAtFairValueFairValueDisclosureMember_f16826b5-1b22-44ac-bd1e-506062b06271" xlink:to="loc_us-gaap_EstimateOfFairValueFairValueDisclosureMember_26449828-65e4-47df-9d1b-d21ba8a3de04" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_17f751b9-35ea-489e-af3a-08465e6e6a7d" xlink:to="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_6b3cd40e-c05c-4a9d-bb76-e1986b8cbbd4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashAndCashEquivalentsFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_6b3cd40e-c05c-4a9d-bb76-e1986b8cbbd4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HeldToMaturitySecuritiesFairValue_894753b4-2ae4-423b-863a-80ec8df87cf9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HeldToMaturitySecuritiesFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:to="loc_us-gaap_HeldToMaturitySecuritiesFairValue_894753b4-2ae4-423b-863a-80ec8df87cf9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoansReceivableFairValueDisclosure_cc848b83-65f5-4c77-80be-8ba2d3668298" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoansReceivableFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:to="loc_us-gaap_LoansReceivableFairValueDisclosure_cc848b83-65f5-4c77-80be-8ba2d3668298" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestReceivableFairValueDisclosure_62ff97bb-e133-41b5-a9a4-dc0a9999ca29" xlink:href="bmrc-20231231.xsd#bmrc_InterestReceivableFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialAssetsBalanceSheetGroupingsAbstract_75fd09b2-2ea7-4311-8f7c-7472a829508e" xlink:to="loc_bmrc_InterestReceivableFairValueDisclosure_62ff97bb-e133-41b5-a9a4-dc0a9999ca29" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueBalanceSheetGroupingFinancialStatementCaptionsLineItems_17f751b9-35ea-489e-af3a-08465e6e6a7d" xlink:to="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepositsFairValueDisclosure_9116ce37-d6f3-4c86-84da-bdce3915fcdc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DepositsFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:to="loc_us-gaap_DepositsFairValueDisclosure_9116ce37-d6f3-4c86-84da-bdce3915fcdc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FederalHomeLoanBankBorrowingsFairValueDisclosure_7b9bfc69-2b73-4525-8aa2-3a6221e20494" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FederalHomeLoanBankBorrowingsFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:to="loc_us-gaap_FederalHomeLoanBankBorrowingsFairValueDisclosure_7b9bfc69-2b73-4525-8aa2-3a6221e20494" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LinesOfCreditFairValueDisclosure_39c6f4dc-f709-4f17-8b72-8d326f07adc0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LinesOfCreditFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:to="loc_us-gaap_LinesOfCreditFairValueDisclosure_39c6f4dc-f709-4f17-8b72-8d326f07adc0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestPayableFairValueDisclosure_14ee596c-2bb2-4313-b9a9-97cbd497e3aa" xlink:href="bmrc-20231231.xsd#bmrc_InterestPayableFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancialInstrumentsFinancialLiabilitiesBalanceSheetGroupingsAbstract_712d6ef3-23c5-434b-903e-ab6ca6f0ce4c" xlink:to="loc_bmrc_InterestPayableFairValueDisclosure_14ee596c-2bb2-4313-b9a9-97cbd497e3aa" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BenefitPlansDeferredCompensationPlanDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BenefitPlansDeferredCompensationPlanDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BenefitPlansDeferredCompensationPlanDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_bde9ffaa-7f4d-425e-ada2-5416260c58ba" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_1b5c65a5-d29b-454a-8aa1-41ff6650b867" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_bde9ffaa-7f4d-425e-ada2-5416260c58ba" xlink:to="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_1b5c65a5-d29b-454a-8aa1-41ff6650b867" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTypeOfDeferredCompensationAxis_c57ebd49-4b5e-4646-9744-e5a94ab7cb10" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTypeOfDeferredCompensationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_1b5c65a5-d29b-454a-8aa1-41ff6650b867" xlink:to="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTypeOfDeferredCompensationAxis_c57ebd49-4b5e-4646-9744-e5a94ab7cb10" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_c57ebd49-4b5e-4646-9744-e5a94ab7cb10_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTypeOfDeferredCompensationAxis_c57ebd49-4b5e-4646-9744-e5a94ab7cb10" xlink:to="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_c57ebd49-4b5e-4646-9744-e5a94ab7cb10_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_d9de9305-84a7-49c1-a82c-af04e7bc8124" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTypeOfDeferredCompensationAxis_c57ebd49-4b5e-4646-9744-e5a94ab7cb10" xlink:to="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_d9de9305-84a7-49c1-a82c-af04e7bc8124" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AnnualSalaryMember_410826b0-e72e-4271-9257-32f95777d5fd" xlink:href="bmrc-20231231.xsd#bmrc_AnnualSalaryMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_d9de9305-84a7-49c1-a82c-af04e7bc8124" xlink:to="loc_bmrc_AnnualSalaryMember_410826b0-e72e-4271-9257-32f95777d5fd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredBonusMember_834a2cef-e7e9-4783-8d21-34a65dbb4eb9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredBonusMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredBonusAndProfitSharingArrangementIndividualContractTypeOfDeferredCompensationDomain_d9de9305-84a7-49c1-a82c-af04e7bc8124" xlink:to="loc_us-gaap_DeferredBonusMember_834a2cef-e7e9-4783-8d21-34a65dbb4eb9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualAxis_2504fe56-a260-462d-8e01-34e9139993b9" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_1b5c65a5-d29b-454a-8aa1-41ff6650b867" xlink:to="loc_srt_TitleOfIndividualAxis_2504fe56-a260-462d-8e01-34e9139993b9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_2504fe56-a260-462d-8e01-34e9139993b9_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_TitleOfIndividualAxis_2504fe56-a260-462d-8e01-34e9139993b9" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_2504fe56-a260-462d-8e01-34e9139993b9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_76b10574-c12f-42c2-9b25-117a4fe36a2b" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_TitleOfIndividualAxis_2504fe56-a260-462d-8e01-34e9139993b9" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_76b10574-c12f-42c2-9b25-117a4fe36a2b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ManagementMember_c2fc8846-cd6a-41c3-948e-feee96e1600c" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ManagementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_76b10574-c12f-42c2-9b25-117a4fe36a2b" xlink:to="loc_srt_ManagementMember_c2fc8846-cd6a-41c3-948e-feee96e1600c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DeferredCompensationArrangementWithIndividualMaximumElectedDeferralByEmployeePercent_e7415f12-a3a4-41f3-8dfb-961ce99a5031" xlink:href="bmrc-20231231.xsd#bmrc_DeferredCompensationArrangementWithIndividualMaximumElectedDeferralByEmployeePercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_bde9ffaa-7f4d-425e-ada2-5416260c58ba" xlink:to="loc_bmrc_DeferredCompensationArrangementWithIndividualMaximumElectedDeferralByEmployeePercent_e7415f12-a3a4-41f3-8dfb-961ce99a5031" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DeferredCompensationArrangementwithIndividualDeferredInterestEarnedPercent_2bd82d29-ba33-4d4d-a83a-93a0c17fda8d" xlink:href="bmrc-20231231.xsd#bmrc_DeferredCompensationArrangementwithIndividualDeferredInterestEarnedPercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_bde9ffaa-7f4d-425e-ada2-5416260c58ba" xlink:to="loc_bmrc_DeferredCompensationArrangementwithIndividualDeferredInterestEarnedPercent_2bd82d29-ba33-4d4d-a83a-93a0c17fda8d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualRecordedLiability_07f2e544-17ec-4c7d-98e5-a85d629bbfd4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredCompensationArrangementWithIndividualRecordedLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_bde9ffaa-7f4d-425e-ada2-5416260c58ba" xlink:to="loc_us-gaap_DeferredCompensationArrangementWithIndividualRecordedLiability_07f2e544-17ec-4c7d-98e5-a85d629bbfd4" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BenefitPlansDefinedContributionPlanandEmployeeStockOwnershipPlanDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BenefitPlansDefinedContributionPlanandEmployeeStockOwnershipPlanDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BenefitPlansDefinedContributionPlanandEmployeeStockOwnershipPlanDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresTable_6cf48363-4ead-4c8d-bd7c-5c7d98f61a3c" xlink:href="bmrc-20231231.xsd#bmrc_ScheduleOfDefinedContributionPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresTable_6cf48363-4ead-4c8d-bd7c-5c7d98f61a3c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameAxis_c1543b17-893a-4693-86e1-f46353f60ea3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetirementPlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresTable_6cf48363-4ead-4c8d-bd7c-5c7d98f61a3c" xlink:to="loc_us-gaap_RetirementPlanNameAxis_c1543b17-893a-4693-86e1-f46353f60ea3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_c1543b17-893a-4693-86e1-f46353f60ea3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RetirementPlanNameAxis_c1543b17-893a-4693-86e1-f46353f60ea3" xlink:to="loc_us-gaap_RetirementPlanNameDomain_c1543b17-893a-4693-86e1-f46353f60ea3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetirementPlanNameDomain_7c703154-0788-4c54-bd7b-cfd9422739a1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetirementPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RetirementPlanNameAxis_c1543b17-893a-4693-86e1-f46353f60ea3" xlink:to="loc_us-gaap_RetirementPlanNameDomain_7c703154-0788-4c54-bd7b-cfd9422739a1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanthe401kPlanMember_ba5a666c-7266-41fe-bd3a-231dde5dfbe7" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanthe401kPlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanNameDomain_7c703154-0788-4c54-bd7b-cfd9422739a1" xlink:to="loc_bmrc_DefinedContributionPlanthe401kPlanMember_ba5a666c-7266-41fe-bd3a-231dde5dfbe7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BankOfMarinEmployeeStockOwnershipAndSavingsPlanMember_583cc6fc-323b-43d0-83a5-666e08bbd849" xlink:href="bmrc-20231231.xsd#bmrc_BankOfMarinEmployeeStockOwnershipAndSavingsPlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RetirementPlanNameDomain_7c703154-0788-4c54-bd7b-cfd9422739a1" xlink:to="loc_bmrc_BankOfMarinEmployeeStockOwnershipAndSavingsPlanMember_583cc6fc-323b-43d0-83a5-666e08bbd849" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanMinimumAgeofEligibleEmployee_e4748a99-c002-41fd-a548-c630d350b603" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanMinimumAgeofEligibleEmployee"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_DefinedContributionPlanMinimumAgeofEligibleEmployee_e4748a99-c002-41fd-a548-c630d350b603" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanMinimumEmploymentPeriodToQualifyForPlan_4523460a-ccd8-4a3f-913c-ef0da1cba56f" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanMinimumEmploymentPeriodToQualifyForPlan"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_DefinedContributionPlanMinimumEmploymentPeriodToQualifyForPlan_4523460a-ccd8-4a3f-913c-ef0da1cba56f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanMinimumAnnualContributionPerEmployeePercent_12454ec7-3cc5-4809-b3a1-2d8a15cd4949" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanMinimumAnnualContributionPerEmployeePercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_DefinedContributionPlanMinimumAnnualContributionPerEmployeePercent_12454ec7-3cc5-4809-b3a1-2d8a15cd4949" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent_0bca8611-7bef-4391-afe4-eae5080ace12" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_us-gaap_DefinedContributionPlanMaximumAnnualContributionsPerEmployeePercent_0bca8611-7bef-4391-afe4-eae5080ace12" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_09cc219e-da0f-472a-a5f5-56f26cee9c78" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_09cc219e-da0f-472a-a5f5-56f26cee9c78" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanEmployerMatchingContributionMaximumAmount_ec36f683-35a1-4301-8afa-b7958b51f231" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanEmployerMatchingContributionMaximumAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_DefinedContributionPlanEmployerMatchingContributionMaximumAmount_ec36f683-35a1-4301-8afa-b7958b51f231" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanEmployersMatchingContributionAnnualVestingPercentage_91856cf2-00fa-4b58-9044-a4bc54957aa3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedContributionPlanEmployersMatchingContributionAnnualVestingPercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_us-gaap_DefinedContributionPlanEmployersMatchingContributionAnnualVestingPercentage_91856cf2-00fa-4b58-9044-a4bc54957aa3" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedContributionPlanNumberOfYearsToBeFullyVested_b7eda145-0cfd-4d2b-8f6a-c22efa7bc0e6" xlink:href="bmrc-20231231.xsd#bmrc_DefinedContributionPlanNumberOfYearsToBeFullyVested"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_bmrc_DefinedContributionPlanNumberOfYearsToBeFullyVested_b7eda145-0cfd-4d2b-8f6a-c22efa7bc0e6" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedContributionPlanCostRecognized_eb645940-32a1-4848-9033-f3f75ac8b2b6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedContributionPlanCostRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_us-gaap_DefinedContributionPlanCostRecognized_eb645940-32a1-4848-9033-f3f75ac8b2b6" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOwnershipPlanESOPCompensationExpense_bee92db6-a0d3-4fc2-8ca3-7ac23aceca64" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeStockOwnershipPlanESOPCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_bmrc_ScheduleOfDefinedContributionPlansDisclosuresLineItems_1614feb9-cb57-4ec4-8a3a-a99c916a2a1f" xlink:to="loc_us-gaap_EmployeeStockOwnershipPlanESOPCompensationExpense_bee92db6-a0d3-4fc2-8ca3-7ac23aceca64" xlink:type="arc" order="9"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/BenefitPlansSupplementalExecutiveRetirementPlanDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#BenefitPlansSupplementalExecutiveRetirementPlanDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/BenefitPlansSupplementalExecutiveRetirementPlanDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedBenefitPlanDisclosureLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_43c94227-9766-4666-bb4c-761f21fcf5c1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_43c94227-9766-4666-bb4c-761f21fcf5c1" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_c841fee5-2116-48bd-9d5e-f52b7a73d1b0" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDefinedBenefitPlansDisclosuresTable_43c94227-9766-4666-bb4c-761f21fcf5c1" xlink:to="loc_srt_RangeAxis_c841fee5-2116-48bd-9d5e-f52b7a73d1b0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_c841fee5-2116-48bd-9d5e-f52b7a73d1b0_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_c841fee5-2116-48bd-9d5e-f52b7a73d1b0" xlink:to="loc_srt_RangeMember_c841fee5-2116-48bd-9d5e-f52b7a73d1b0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_f6473a3a-430b-4e60-ab79-a5c2a35a04fe" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_c841fee5-2116-48bd-9d5e-f52b7a73d1b0" xlink:to="loc_srt_RangeMember_f6473a3a-430b-4e60-ab79-a5c2a35a04fe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_5d65d25a-32ae-45c3-a24e-529ec9386594" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_f6473a3a-430b-4e60-ab79-a5c2a35a04fe" xlink:to="loc_srt_MinimumMember_5d65d25a-32ae-45c3-a24e-529ec9386594" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_601cf343-d071-46da-a30e-b846a29a78b8" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_f6473a3a-430b-4e60-ab79-a5c2a35a04fe" xlink:to="loc_srt_MaximumMember_601cf343-d071-46da-a30e-b846a29a78b8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedBenefitPlanPercentageOfSalaryPaidUponRetirement_df70b743-4ac7-4c76-b105-3303585072db" xlink:href="bmrc-20231231.xsd#bmrc_DefinedBenefitPlanPercentageOfSalaryPaidUponRetirement"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_bmrc_DefinedBenefitPlanPercentageOfSalaryPaidUponRetirement_df70b743-4ac7-4c76-b105-3303585072db" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedBenefitPlanPaymentPeriodDeterminedByServicePeriod_4ac4b9fe-2d3c-4d43-9a51-48539ddf4ad3" xlink:href="bmrc-20231231.xsd#bmrc_DefinedBenefitPlanPaymentPeriodDeterminedByServicePeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_bmrc_DefinedBenefitPlanPaymentPeriodDeterminedByServicePeriod_4ac4b9fe-2d3c-4d43-9a51-48539ddf4ad3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedBenefitsPlanPeriodBeforeRatableVestingBegins_98364f4b-7096-4f7e-b844-2300d295318f" xlink:href="bmrc-20231231.xsd#bmrc_DefinedBenefitsPlanPeriodBeforeRatableVestingBegins"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_bmrc_DefinedBenefitsPlanPeriodBeforeRatableVestingBegins_98364f4b-7096-4f7e-b844-2300d295318f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DefinedBenefitsPlanAgeRatableVestingEnds_f91eb9f6-f9e4-45a9-894f-11a6d4be167d" xlink:href="bmrc-20231231.xsd#bmrc_DefinedBenefitsPlanAgeRatableVestingEnds"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_bmrc_DefinedBenefitsPlanAgeRatableVestingEnds_f91eb9f6-f9e4-45a9-894f-11a6d4be167d" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DefinedBenefitPlanAmountsRecognizedInBalanceSheet_c4259235-874d-4efc-9d9b-320f40455224" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DefinedBenefitPlanAmountsRecognizedInBalanceSheet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DefinedBenefitPlanDisclosureLineItems_0886f3b0-ea0a-4f1c-8791-0f563c124d6b" xlink:to="loc_us-gaap_DefinedBenefitPlanAmountsRecognizedInBalanceSheet_c4259235-874d-4efc-9d9b-320f40455224" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/IncomeTaxesScheduleofDeferredTaxAssetandLiabilityDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#IncomeTaxesScheduleofDeferredTaxAssetandLiabilityDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/IncomeTaxesScheduleofDeferredTaxAssetandLiabilityDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingLossCarryforwardsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLossCarryforwardsTable_49f750c1-8054-4c54-a5b7-fb673edf54ad" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingLossCarryforwardsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_OperatingLossCarryforwardsTable_49f750c1-8054-4c54-a5b7-fb673edf54ad" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityAxis_aa6a7189-5324-4838-847d-b71bdd78a251" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxAuthorityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_OperatingLossCarryforwardsTable_49f750c1-8054-4c54-a5b7-fb673edf54ad" xlink:to="loc_us-gaap_IncomeTaxAuthorityAxis_aa6a7189-5324-4838-847d-b71bdd78a251" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_aa6a7189-5324-4838-847d-b71bdd78a251_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxAuthorityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_aa6a7189-5324-4838-847d-b71bdd78a251" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_aa6a7189-5324-4838-847d-b71bdd78a251_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_3b4a4ccb-6955-4202-9464-21eda0919073" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxAuthorityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_aa6a7189-5324-4838-847d-b71bdd78a251" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_3b4a4ccb-6955-4202-9464-21eda0919073" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StateAndLocalJurisdictionMember_da95ee67-b9d1-472f-85c4-c1e8d1d1b732" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StateAndLocalJurisdictionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain_3b4a4ccb-6955-4202-9464-21eda0919073" xlink:to="loc_us-gaap_StateAndLocalJurisdictionMember_da95ee67-b9d1-472f-85c4-c1e8d1d1b732" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsGrossAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DeferredTaxAssetsUnrealizedLossesonAvailableforSaleSecuritiesNet_630d857b-13f6-4101-9899-916f845ec231" xlink:href="bmrc-20231231.xsd#bmrc_DeferredTaxAssetsUnrealizedLossesonAvailableforSaleSecuritiesNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_bmrc_DeferredTaxAssetsUnrealizedLossesonAvailableforSaleSecuritiesNet_630d857b-13f6-4101-9899-916f845ec231" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAllowanceForDoubtfulAccounts_9c9abc7f-2514-49d1-bea4-fad87dec5143" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAllowanceForDoubtfulAccounts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAllowanceForDoubtfulAccounts_9c9abc7f-2514-49d1-bea4-fad87dec5143" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OperatingLeaseAndFinanceLeaseLiability_480c5d12-27e0-4592-80b9-88fe602bb067" xlink:href="bmrc-20231231.xsd#bmrc_OperatingLeaseAndFinanceLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_bmrc_OperatingLeaseAndFinanceLeaseLiability_480c5d12-27e0-4592-80b9-88fe602bb067" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsPensions_71708147-5834-418f-b46b-c96952cfa7a2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsPensions"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsPensions_71708147-5834-418f-b46b-c96952cfa7a2" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities_64e78e8a-4fce-4078-ae3a-b0f7fec04921" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsAccruedLiabilities_64e78e8a-4fce-4078-ae3a-b0f7fec04921" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_82773ef9-089c-4c6d-b021-fba662480b25" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_82773ef9-089c-4c6d-b021-fba662480b25" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DeferredTaxAssetFairValueAdjustmentLoansReceivable_a3ac0d42-f9f8-4173-b34e-2d2e9ee6d40d" xlink:href="bmrc-20231231.xsd#bmrc_DeferredTaxAssetFairValueAdjustmentLoansReceivable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_bmrc_DeferredTaxAssetFairValueAdjustmentLoansReceivable_a3ac0d42-f9f8-4173-b34e-2d2e9ee6d40d" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_6fbaeccb-0378-489e-bb97-ecf80164f635" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_6fbaeccb-0378-489e-bb97-ecf80164f635" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsStateTaxes_d9651083-0d78-4f1c-afcc-747f62cc37cc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsStateTaxes"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsStateTaxes_d9651083-0d78-4f1c-afcc-747f62cc37cc" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsPropertyPlantAndEquipment_c78f9c6f-54f2-40ec-92a8-16cb29823a9b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsPropertyPlantAndEquipment_c78f9c6f-54f2-40ec-92a8-16cb29823a9b" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOther_2f9e696e-7f1d-4dfa-8888-70793cc70397" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsOther_2f9e696e-7f1d-4dfa-8888-70793cc70397" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_8e642176-91ee-4bda-b982-36e07a2e8905" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxAssetsGrossAbstract_d819b709-8c18-4e78-83b4-77f0a83abd3c" xlink:to="loc_us-gaap_DeferredTaxAssetsGross_8e642176-91ee-4bda-b982-36e07a2e8905" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxLiabilitiesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OperatingLeaseAndFinanceLeaseRightOfUseAsset_dbc48dc0-2e8b-4877-af27-64dafc8ae329" xlink:href="bmrc-20231231.xsd#bmrc_OperatingLeaseAndFinanceLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:to="loc_bmrc_OperatingLeaseAndFinanceLeaseRightOfUseAsset_dbc48dc0-2e8b-4877-af27-64dafc8ae329" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DeferredTaxLiabilitiesDeferredLoanOriginationCosts_4fafc715-1cd7-4d64-97e1-04d04493db20" xlink:href="bmrc-20231231.xsd#bmrc_DeferredTaxLiabilitiesDeferredLoanOriginationCosts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:to="loc_bmrc_DeferredTaxLiabilitiesDeferredLoanOriginationCosts_4fafc715-1cd7-4d64-97e1-04d04493db20" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets_858f9f27-b22a-4337-8bec-c3f56c68a683" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets_858f9f27-b22a-4337-8bec-c3f56c68a683" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesOther_a8287be7-2fd3-4432-856c-184a44806223" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxLiabilitiesOther"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesOther_a8287be7-2fd3-4432-856c-184a44806223" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_b118df30-2ae8-4af4-8e13-d478645dd5f9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredTaxLiabilitiesAbstract_1a074acd-d3fe-478d-ade7-1881892618f8" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilities_b118df30-2ae8-4af4-8e13-d478645dd5f9" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_79b91d0c-8756-4638-a57a-d0020df62d6a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_79b91d0c-8756-4638-a57a-d0020df62d6a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLossCarryforwards_d9a3575e-c9aa-4f80-b1b6-3b9a5c7a7bca" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingLossCarryforwards"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_OperatingLossCarryforwards_d9a3575e-c9aa-4f80-b1b6-3b9a5c7a7bca" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_7ba0e02a-fc75-42c9-aaca-b7d85e737df0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_361146b7-dd79-4d51-b4a8-40817b6ee9c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DeferredTaxAssetsValuationAllowance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingLossCarryforwardsLineItems_dcedc404-876f-480d-a71b-18fe2c195794" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_361146b7-dd79-4d51-b4a8-40817b6ee9c4" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CommitmentsandContingenciesNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CommitmentsandContingenciesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CommitmentsandContingenciesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LossContingenciesLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LossContingenciesTable_1c0a109d-8443-434f-ade4-492698a5b46a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LossContingenciesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_us-gaap_LossContingenciesTable_1c0a109d-8443-434f-ade4-492698a5b46a" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_a52c4970-95a7-4bde-b340-e81aa22d2ec1" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LossContingenciesTable_1c0a109d-8443-434f-ade4-492698a5b46a" xlink:to="loc_srt_RangeAxis_a52c4970-95a7-4bde-b340-e81aa22d2ec1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_a52c4970-95a7-4bde-b340-e81aa22d2ec1_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_a52c4970-95a7-4bde-b340-e81aa22d2ec1" xlink:to="loc_srt_RangeMember_a52c4970-95a7-4bde-b340-e81aa22d2ec1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_ec3a37fe-22a3-4398-882c-b1c8f758a9f9" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_a52c4970-95a7-4bde-b340-e81aa22d2ec1" xlink:to="loc_srt_RangeMember_ec3a37fe-22a3-4398-882c-b1c8f758a9f9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_cdc711b4-0326-4f72-98a9-805bde0b3548" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_ec3a37fe-22a3-4398-882c-b1c8f758a9f9" xlink:to="loc_srt_MinimumMember_cdc711b4-0326-4f72-98a9-805bde0b3548" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_19fc9c7f-0903-4252-a9cd-773aecea35d5" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_ec3a37fe-22a3-4398-882c-b1c8f758a9f9" xlink:to="loc_srt_MaximumMember_19fc9c7f-0903-4252-a9cd-773aecea35d5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseRemainingLeaseTerm_f5125083-9455-4eb7-b05f-e8f0ab3f7dbf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeOperatingLeaseRemainingLeaseTerm"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_us-gaap_LesseeOperatingLeaseRemainingLeaseTerm_f5125083-9455-4eb7-b05f-e8f0ab3f7dbf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeFinanceLeaseTermOfContract1_8fa613e1-ad0b-4420-8d02-ae1b48de4605" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeFinanceLeaseTermOfContract1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_us-gaap_LesseeFinanceLeaseTermOfContract1_8fa613e1-ad0b-4420-8d02-ae1b48de4605" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_246bc2c0-e26a-4830-9280-69805d984eb4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_246bc2c0-e26a-4830-9280-69805d984eb4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCashAndCashEquivalents_34e875e3-3875-46b1-8c80-8a3a86c6d4d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedCashAndCashEquivalents"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_us-gaap_RestrictedCashAndCashEquivalents_34e875e3-3875-46b1-8c80-8a3a86c6d4d8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LesseeOperatingLeaseLeaseNotYetCommencedLiability_2f9ba073-7d6c-40d7-8553-5b3fed9a0cd9" xlink:href="bmrc-20231231.xsd#bmrc_LesseeOperatingLeaseLeaseNotYetCommencedLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LossContingenciesLineItems_b626736a-1e04-4d7a-88b4-398b17dc25f4" xlink:to="loc_bmrc_LesseeOperatingLeaseLeaseNotYetCommencedLiability_2f9ba073-7d6c-40d7-8553-5b3fed9a0cd9" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/ConcentrationsofCreditRiskDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#ConcentrationsofCreditRiskDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/ConcentrationsofCreditRiskDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskLineItems_ca61a5ee-3f25-4f7c-b3ff-2337d2169229" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ConcentrationRiskLineItems_ca61a5ee-3f25-4f7c-b3ff-2337d2169229" xlink:to="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_b92b5a97-3af0-4b56-b304-c58fb106fd8e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_b92b5a97-3af0-4b56-b304-c58fb106fd8e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_b92b5a97-3af0-4b56-b304-c58fb106fd8e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_b92b5a97-3af0-4b56-b304-c58fb106fd8e" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_b92b5a97-3af0-4b56-b304-c58fb106fd8e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskBenchmarkDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_b92b5a97-3af0-4b56-b304-c58fb106fd8e" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_6ca3c5e7-3ee8-4892-b744-604f84135798" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasuryAndGovernmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_6ca3c5e7-3ee8-4892-b744-604f84135798" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember_9e77ee16-e600-430c-957d-de2a24e9bebe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:to="loc_us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember_9e77ee16-e600-430c-957d-de2a24e9bebe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoansReceivableMember_17256ef6-0f05-4e07-a797-420e18d76b21" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoansReceivableMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:to="loc_us-gaap_LoansReceivableMember_17256ef6-0f05-4e07-a797-420e18d76b21" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgagesMember_504c2739-3cf3-44b7-9784-55a8edbed289" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgagesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_7b35cf85-c2fb-4c64-94ec-67ab017d55ff" xlink:to="loc_us-gaap_MortgagesMember_504c2739-3cf3-44b7-9784-55a8edbed289" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis_632b5deb-6818-41c4-81d1-f396f8bc9ff7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_us-gaap_ConcentrationRiskByTypeAxis_632b5deb-6818-41c4-81d1-f396f8bc9ff7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_632b5deb-6818-41c4-81d1-f396f8bc9ff7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_632b5deb-6818-41c4-81d1-f396f8bc9ff7" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_632b5deb-6818-41c4-81d1-f396f8bc9ff7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_88f783a3-af37-4580-b0e3-819122a0d64b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_632b5deb-6818-41c4-81d1-f396f8bc9ff7" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_88f783a3-af37-4580-b0e3-819122a0d64b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditConcentrationRiskMember_d201246f-4485-4b59-b437-98430f8d669a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditConcentrationRiskMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskTypeDomain_88f783a3-af37-4580-b0e3-819122a0d64b" xlink:to="loc_us-gaap_CreditConcentrationRiskMember_d201246f-4485-4b59-b437-98430f8d669a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_8f99f6ce-5aef-49b3-aebb-e92eab2371e3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_us-gaap_FinancialInstrumentAxis_8f99f6ce-5aef-49b3-aebb-e92eab2371e3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_8f99f6ce-5aef-49b3-aebb-e92eab2371e3_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_8f99f6ce-5aef-49b3-aebb-e92eab2371e3" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_8f99f6ce-5aef-49b3-aebb-e92eab2371e3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_073fa9fe-3bb3-4444-a510-bc5c65dccd46" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_8f99f6ce-5aef-49b3-aebb-e92eab2371e3" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_073fa9fe-3bb3-4444-a510-bc5c65dccd46" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_USGovernmentAndGovernmentSponsoredEnterprisesMember_2ce513da-4da3-40d4-8224-2a6b5e102855" xlink:href="bmrc-20231231.xsd#bmrc_USGovernmentAndGovernmentSponsoredEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_073fa9fe-3bb3-4444-a510-bc5c65dccd46" xlink:to="loc_bmrc_USGovernmentAndGovernmentSponsoredEnterprisesMember_2ce513da-4da3-40d4-8224-2a6b5e102855" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember_0d127bef-0011-4ef1-a9c9-46b54c4e3199" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_073fa9fe-3bb3-4444-a510-bc5c65dccd46" xlink:to="loc_us-gaap_MortgageBackedSecuritiesIssuedByPrivateEnterprisesMember_0d127bef-0011-4ef1-a9c9-46b54c4e3199" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_6a71248b-e216-42a0-b478-994f6d12c414" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_6a71248b-e216-42a0-b478-994f6d12c414" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6a71248b-e216-42a0-b478-994f6d12c414_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_6a71248b-e216-42a0-b478-994f6d12c414" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_6a71248b-e216-42a0-b478-994f6d12c414_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_df76a664-2259-457d-af52-0209a9e1077f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivablePortfolioSegmentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentAxis_6a71248b-e216-42a0-b478-994f6d12c414" xlink:to="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_df76a664-2259-457d-af52-0209a9e1077f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResidentialPortfolioSegmentMember_a6f77c5a-53a0-42a0-a1e7-528a2dbec474" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResidentialPortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_df76a664-2259-457d-af52-0209a9e1077f" xlink:to="loc_us-gaap_ResidentialPortfolioSegmentMember_a6f77c5a-53a0-42a0-a1e7-528a2dbec474" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_b0fbef0b-cc87-4256-8b88-017baa1a09d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommercialRealEstatePortfolioSegmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivablePortfolioSegmentDomain_df76a664-2259-457d-af52-0209a9e1077f" xlink:to="loc_us-gaap_CommercialRealEstatePortfolioSegmentMember_b0fbef0b-cc87-4256-8b88-017baa1a09d8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_2f482aa8-4bec-4f73-83ea-f30a09a8cea5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentByClassOfFinancingReceivableAxis_ceb24cec-f8fc-42e4-800d-e29a4ddd2ffc" xlink:to="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_2f482aa8-4bec-4f73-83ea-f30a09a8cea5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_f24cbae2-6200-49f5-b99d-bea58a51ef21" xlink:href="bmrc-20231231.xsd#bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FinancingReceivableRecordedInvestmentClassOfFinancingReceivableDomain_2f482aa8-4bec-4f73-83ea-f30a09a8cea5" xlink:to="loc_bmrc_CommercialRealEstateLoanNonOwnerOccupiedMember_f24cbae2-6200-49f5-b99d-bea58a51ef21" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementGeographicalAxis_14098e05-6bca-4364-b892-6c411ae66332" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_StatementGeographicalAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ConcentrationRiskTable_3ac163b7-b033-495e-aa17-a32397c079e0" xlink:to="loc_srt_StatementGeographicalAxis_14098e05-6bca-4364-b892-6c411ae66332" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_14098e05-6bca-4364-b892-6c411ae66332_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementGeographicalAxis_14098e05-6bca-4364-b892-6c411ae66332" xlink:to="loc_srt_SegmentGeographicalDomain_14098e05-6bca-4364-b892-6c411ae66332_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SegmentGeographicalDomain_c3ae77bb-37b6-4ad2-b28f-7e75305a9246" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_SegmentGeographicalDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementGeographicalAxis_14098e05-6bca-4364-b892-6c411ae66332" xlink:to="loc_srt_SegmentGeographicalDomain_c3ae77bb-37b6-4ad2-b28f-7e75305a9246" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_SanFranciscoMember_ca70350f-363c-492b-acf3-99e8a94bfb70" xlink:href="bmrc-20231231.xsd#bmrc_SanFranciscoMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SegmentGeographicalDomain_c3ae77bb-37b6-4ad2-b28f-7e75305a9246" xlink:to="loc_bmrc_SanFranciscoMember_ca70350f-363c-492b-acf3-99e8a94bfb70" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskCreditRiskFinancialInstrumentMaximumExposure_3d6effe3-761e-47c7-9913-0057a976c677" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskCreditRiskFinancialInstrumentMaximumExposure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskLineItems_ca61a5ee-3f25-4f7c-b3ff-2337d2169229" xlink:to="loc_us-gaap_ConcentrationRiskCreditRiskFinancialInstrumentMaximumExposure_3d6effe3-761e-47c7-9913-0057a976c677" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ConcentrationRiskPercentage1_d8a357bc-745a-4cf5-bf57-56ba967a6c56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ConcentrationRiskPercentage1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskLineItems_ca61a5ee-3f25-4f7c-b3ff-2337d2169229" xlink:to="loc_us-gaap_ConcentrationRiskPercentage1_d8a357bc-745a-4cf5-bf57-56ba967a6c56" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ConcentrationRiskPercentageThresholdForMajorBorrower_2b455bc4-4e42-489f-9cc5-58f5b883669e" xlink:href="bmrc-20231231.xsd#bmrc_ConcentrationRiskPercentageThresholdForMajorBorrower"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskLineItems_ca61a5ee-3f25-4f7c-b3ff-2337d2169229" xlink:to="loc_bmrc_ConcentrationRiskPercentageThresholdForMajorBorrower_2b455bc4-4e42-489f-9cc5-58f5b883669e" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#DerivativeFinancialInstrumentsandHedgingActivitiesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_84aea3f3-fc07-4b42-9915-78919737eebe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_4b9b97eb-4f7d-4830-989b-fb1f3cbd4732" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_84aea3f3-fc07-4b42-9915-78919737eebe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateSwapMember_7dfd35c5-e220-4409-b917-c46653747ce7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestRateSwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_84aea3f3-fc07-4b42-9915-78919737eebe" xlink:to="loc_us-gaap_InterestRateSwapMember_7dfd35c5-e220-4409-b917-c46653747ce7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:to="loc_srt_RangeAxis_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d" xlink:to="loc_srt_RangeMember_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_4751eeda-ec2f-43be-b06b-c0f9dd9bf3eb" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_0a52d390-04fe-46ac-aba9-7e2ef87d1d3d" xlink:to="loc_srt_RangeMember_4751eeda-ec2f-43be-b06b-c0f9dd9bf3eb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_5599df77-2346-4cfe-af11-e6294536cf44" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_4751eeda-ec2f-43be-b06b-c0f9dd9bf3eb" xlink:to="loc_srt_MinimumMember_5599df77-2346-4cfe-af11-e6294536cf44" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_6dde7a2b-1686-48d4-959c-035e24381075" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_4751eeda-ec2f-43be-b06b-c0f9dd9bf3eb" xlink:to="loc_srt_MaximumMember_6dde7a2b-1686-48d4-959c-035e24381075" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33d05bff-8a86-4450-9e3c-5c313919acc0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33d05bff-8a86-4450-9e3c-5c313919acc0" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_33d05bff-8a86-4450-9e3c-5c313919acc0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33d05bff-8a86-4450-9e3c-5c313919acc0" xlink:to="loc_us-gaap_HedgingRelationshipDomain_33d05bff-8a86-4450-9e3c-5c313919acc0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_83873951-51d4-476e-92f9-fe8270b9ad65" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_33d05bff-8a86-4450-9e3c-5c313919acc0" xlink:to="loc_us-gaap_HedgingRelationshipDomain_83873951-51d4-476e-92f9-fe8270b9ad65" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueHedgingMember_7154cec3-f98e-4377-9dc1-33837f735ddf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_83873951-51d4-476e-92f9-fe8270b9ad65" xlink:to="loc_us-gaap_FairValueHedgingMember_7154cec3-f98e-4377-9dc1-33837f735ddf" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_7f2daa2c-1828-4e1b-a505-6b390cdd6f99" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_056c0c52-feeb-4585-8131-7c8756a160d2" xlink:to="loc_us-gaap_HedgingDesignationAxis_7f2daa2c-1828-4e1b-a505-6b390cdd6f99" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_7f2daa2c-1828-4e1b-a505-6b390cdd6f99_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_7f2daa2c-1828-4e1b-a505-6b390cdd6f99" xlink:to="loc_us-gaap_HedgingDesignationDomain_7f2daa2c-1828-4e1b-a505-6b390cdd6f99_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_2feb19b1-4bac-4104-b379-e21278a18c27" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_7f2daa2c-1828-4e1b-a505-6b390cdd6f99" xlink:to="loc_us-gaap_HedgingDesignationDomain_2feb19b1-4bac-4104-b379-e21278a18c27" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_b0925c59-0820-4094-9ed4-515fa73217bb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_2feb19b1-4bac-4104-b379-e21278a18c27" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_b0925c59-0820-4094-9ed4-515fa73217bb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNotionalAmount_638181cf-7f6d-4373-9a05-1ef00f127ed7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:to="loc_us-gaap_DerivativeNotionalAmount_638181cf-7f6d-4373-9a05-1ef00f127ed7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeTermOfContract_e5f394c9-ea3c-4695-94bc-afb6902c0cc9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeTermOfContract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:to="loc_us-gaap_DerivativeTermOfContract_e5f394c9-ea3c-4695-94bc-afb6902c0cc9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeNumberOfInstrumentsHeld_fa26b8e8-cce6-4d19-b761-97a5ea6b52ab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeNumberOfInstrumentsHeld"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:to="loc_us-gaap_DerivativeNumberOfInstrumentsHeld_fa26b8e8-cce6-4d19-b761-97a5ea6b52ab" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_NumberOfDerivativeInstrumentsTerminated_959a6e6e-d937-45e1-a6c1-ce5ceac6e18c" xlink:href="bmrc-20231231.xsd#bmrc_NumberOfDerivativeInstrumentsTerminated"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_010a8827-e23a-4161-8351-b7914c623aa0" xlink:to="loc_bmrc_NumberOfDerivativeInstrumentsTerminated_959a6e6e-d937-45e1-a6c1-ce5ceac6e18c" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInformationonDerivativesDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInformationonDerivativesDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInformationonDerivativesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_26c053a5-a6f6-4d6f-9e5d-9cde351b8181" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_26c053a5-a6f6-4d6f-9e5d-9cde351b8181" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_26c053a5-a6f6-4d6f-9e5d-9cde351b8181_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_26c053a5-a6f6-4d6f-9e5d-9cde351b8181" xlink:to="loc_us-gaap_HedgingRelationshipDomain_26c053a5-a6f6-4d6f-9e5d-9cde351b8181_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_dcf22ce4-a140-4dfc-9830-59661f65d11d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_26c053a5-a6f6-4d6f-9e5d-9cde351b8181" xlink:to="loc_us-gaap_HedgingRelationshipDomain_dcf22ce4-a140-4dfc-9830-59661f65d11d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueHedgingMember_ba02aa9f-2dd7-4942-9186-9f12daa2a5da" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_dcf22ce4-a140-4dfc-9830-59661f65d11d" xlink:to="loc_us-gaap_FairValueHedgingMember_ba02aa9f-2dd7-4942-9186-9f12daa2a5da" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationAxis_b3855593-471b-4d64-a013-3b00cef5775b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:to="loc_us-gaap_HedgingDesignationAxis_b3855593-471b-4d64-a013-3b00cef5775b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_b3855593-471b-4d64-a013-3b00cef5775b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_HedgingDesignationAxis_b3855593-471b-4d64-a013-3b00cef5775b" xlink:to="loc_us-gaap_HedgingDesignationDomain_b3855593-471b-4d64-a013-3b00cef5775b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingDesignationDomain_31cccf93-4d12-48dc-aed8-abb44a8b53c7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingDesignationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_HedgingDesignationAxis_b3855593-471b-4d64-a013-3b00cef5775b" xlink:to="loc_us-gaap_HedgingDesignationDomain_31cccf93-4d12-48dc-aed8-abb44a8b53c7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DesignatedAsHedgingInstrumentMember_dc2dc832-a1fb-4916-879f-bcd2ef924eff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DesignatedAsHedgingInstrumentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingDesignationDomain_31cccf93-4d12-48dc-aed8-abb44a8b53c7" xlink:to="loc_us-gaap_DesignatedAsHedgingInstrumentMember_dc2dc832-a1fb-4916-879f-bcd2ef924eff" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentRiskAxis_2fab0239-a5c5-435c-9f6d-4546afc32afc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentRiskAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:to="loc_us-gaap_DerivativeInstrumentRiskAxis_2fab0239-a5c5-435c-9f6d-4546afc32afc" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_2fab0239-a5c5-435c-9f6d-4546afc32afc_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_2fab0239-a5c5-435c-9f6d-4546afc32afc" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_2fab0239-a5c5-435c-9f6d-4546afc32afc_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeContractTypeDomain_a205ec21-58bc-4a67-a888-62e85c6fd736" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeContractTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentRiskAxis_2fab0239-a5c5-435c-9f6d-4546afc32afc" xlink:to="loc_us-gaap_DerivativeContractTypeDomain_a205ec21-58bc-4a67-a888-62e85c6fd736" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateSwapMember_b48a6ae8-f28a-48bb-b0d2-bec688cec694" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestRateSwapMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_a205ec21-58bc-4a67-a888-62e85c6fd736" xlink:to="loc_us-gaap_InterestRateSwapMember_b48a6ae8-f28a-48bb-b0d2-bec688cec694" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestRateContractMember_b4e96215-9c00-4b9c-9017-fb8666d9ffe7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestRateContractMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativeContractTypeDomain_a205ec21-58bc-4a67-a888-62e85c6fd736" xlink:to="loc_us-gaap_InterestRateContractMember_b4e96215-9c00-4b9c-9017-fb8666d9ffe7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_aad31c6e-b82a-40aa-ae7f-c7f4940944df" xlink:to="loc_us-gaap_FinancialInstrumentAxis_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c6766bd2-75c7-4195-8c64-8c07b4ee9d47" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_a1eb246f-2bcf-4d26-a703-4d4bfe6a005c" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c6766bd2-75c7-4195-8c64-8c07b4ee9d47" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DebtSecuritiesAvailableForSaleMember_c7af6173-7acc-4b0b-a357-6eb03283037a" xlink:href="bmrc-20231231.xsd#bmrc_DebtSecuritiesAvailableForSaleMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c6766bd2-75c7-4195-8c64-8c07b4ee9d47" xlink:to="loc_bmrc_DebtSecuritiesAvailableForSaleMember_c7af6173-7acc-4b0b-a357-6eb03283037a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LoansReceivableMember_9e9e0815-9a93-4dfc-9c34-7cc41b5a1f82" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LoansReceivableMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_c6766bd2-75c7-4195-8c64-8c07b4ee9d47" xlink:to="loc_us-gaap_LoansReceivableMember_9e9e0815-9a93-4dfc-9c34-7cc41b5a1f82" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetNotionalAmount_823f8ecb-b71d-472f-8891-4362141b3679" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeAssetNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_DerivativeAssetNotionalAmount_823f8ecb-b71d-472f-8891-4362141b3679" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilityNotionalAmount_2bf16262-bc92-4868-9ef8-f2f3d024156d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilityNotionalAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_DerivativeLiabilityNotionalAmount_2bf16262-bc92-4868-9ef8-f2f3d024156d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssets_aa10f268-8617-4b91-8ea0-ef491e01e4e1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_DerivativeAssets_aa10f268-8617-4b91-8ea0-ef491e01e4e1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_be77a5d1-3a03-4789-8927-ead0e520a51e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_DerivativeLiabilities_be77a5d1-3a03-4789-8927-ead0e520a51e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgedAssetFairValueHedge_60946836-5a44-4dfc-baeb-45d0039d38f0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgedAssetFairValueHedge"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_HedgedAssetFairValueHedge_60946836-5a44-4dfc-baeb-45d0039d38f0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgedAssetFairValueHedgeCumulativeIncreaseDecrease_69b07704-94b0-4d12-b391-91fad04bd5d5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgedAssetFairValueHedgeCumulativeIncreaseDecrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_HedgedAssetFairValueHedgeCumulativeIncreaseDecrease_69b07704-94b0-4d12-b391-91fad04bd5d5" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss_0f6fd82d-d3bf-40b2-bb2c-c58c8d2d4362" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_0e986f0d-84da-4e03-840e-54390a6c2eec" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleAccruedInterestAfterAllowanceForCreditLoss_0f6fd82d-d3bf-40b2-bb2c-c58c8d2d4362" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInterestIncomeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInterestIncomeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofInterestIncomeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_6d5be419-5d68-435f-99e1-2a32f7c9b719" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_6d5be419-5d68-435f-99e1-2a32f7c9b719" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_f58d0e85-42e3-4cfb-9df2-c7fcc507158f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_6d5be419-5d68-435f-99e1-2a32f7c9b719" xlink:to="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_f58d0e85-42e3-4cfb-9df2-c7fcc507158f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_f58d0e85-42e3-4cfb-9df2-c7fcc507158f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_f58d0e85-42e3-4cfb-9df2-c7fcc507158f" xlink:to="loc_us-gaap_HedgingRelationshipDomain_f58d0e85-42e3-4cfb-9df2-c7fcc507158f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HedgingRelationshipDomain_70926868-807a-4a4f-bf99-53764b7c0fd7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HedgingRelationshipDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DerivativeInstrumentsGainLossByHedgingRelationshipAxis_f58d0e85-42e3-4cfb-9df2-c7fcc507158f" xlink:to="loc_us-gaap_HedgingRelationshipDomain_70926868-807a-4a4f-bf99-53764b7c0fd7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueHedgingMember_15f28d53-c5e6-4e59-abbf-c852e8376983" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueHedgingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_HedgingRelationshipDomain_70926868-807a-4a4f-bf99-53764b7c0fd7" xlink:to="loc_us-gaap_FairValueHedgingMember_15f28d53-c5e6-4e59-abbf-c852e8376983" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeAxis_020abafd-8f50-4a42-98e7-e2762e3e2d5b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_6d5be419-5d68-435f-99e1-2a32f7c9b719" xlink:to="loc_us-gaap_InvestmentTypeAxis_020abafd-8f50-4a42-98e7-e2762e3e2d5b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_020abafd-8f50-4a42-98e7-e2762e3e2d5b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_InvestmentTypeAxis_020abafd-8f50-4a42-98e7-e2762e3e2d5b" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_020abafd-8f50-4a42-98e7-e2762e3e2d5b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_abe49ac1-27b8-45b6-981b-d20e6d2d7060" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_InvestmentTypeAxis_020abafd-8f50-4a42-98e7-e2762e3e2d5b" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_abe49ac1-27b8-45b6-981b-d20e6d2d7060" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestOnInvestmentSecuritiesMember_40816182-893d-4df5-aeaa-c19a10c08284" xlink:href="bmrc-20231231.xsd#bmrc_InterestOnInvestmentSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_abe49ac1-27b8-45b6-981b-d20e6d2d7060" xlink:to="loc_bmrc_InterestOnInvestmentSecuritiesMember_40816182-893d-4df5-aeaa-c19a10c08284" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InterestAndFeesOnLoansMember_beeed57b-6251-476a-af4e-5953737fcc86" xlink:href="bmrc-20231231.xsd#bmrc_InterestAndFeesOnLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_abe49ac1-27b8-45b6-981b-d20e6d2d7060" xlink:to="loc_bmrc_InterestAndFeesOnLoansMember_beeed57b-6251-476a-af4e-5953737fcc86" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInFairValueOfInterestRateFairValueHedgingInstruments1_12eefe08-672f-487e-95bc-e644dbd74025" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInFairValueOfInterestRateFairValueHedgingInstruments1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_us-gaap_IncreaseDecreaseInFairValueOfInterestRateFairValueHedgingInstruments1_12eefe08-672f-487e-95bc-e644dbd74025" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DerivativeHedgedInterestEarnedPaid_085fdab1-65e7-447e-8c30-8eac4b6d25e9" xlink:href="bmrc-20231231.xsd#bmrc_DerivativeHedgedInterestEarnedPaid"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_bmrc_DerivativeHedgedInterestEarnedPaid_085fdab1-65e7-447e-8c30-8eac4b6d25e9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInFairValueOfHedgedItemInInterestRateFairValueHedge1_ec9de81c-e134-48b5-8685-7f52f71469ab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInFairValueOfHedgedItemInInterestRateFairValueHedge1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_us-gaap_IncreaseDecreaseInFairValueOfHedgedItemInInterestRateFairValueHedge1_ec9de81c-e134-48b5-8685-7f52f71469ab" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DerivativeIncreaseDecreaseInValueOfYieldMaintenanceAgreement_2db10bdd-2268-4583-be5c-d99530a99d5f" xlink:href="bmrc-20231231.xsd#bmrc_DerivativeIncreaseDecreaseInValueOfYieldMaintenanceAgreement"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_bmrc_DerivativeIncreaseDecreaseInValueOfYieldMaintenanceAgreement_2db10bdd-2268-4583-be5c-d99530a99d5f" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_995da708-7c5d-4c79-a8b5-6704bb3f1576" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_12aedb0d-68a6-43ba-8fe3-b4243a9f21ac" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_995da708-7c5d-4c79-a8b5-6704bb3f1576" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofAssetsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofAssetsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofAssetsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_14ff7058-e32a-458b-923d-a0be91d1a9b2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_14ff7058-e32a-458b-923d-a0be91d1a9b2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CounterpartyNameAxis_9b703e22-bf7c-4f7e-8810-8b17e8b170bd" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CounterpartyNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_14ff7058-e32a-458b-923d-a0be91d1a9b2" xlink:to="loc_srt_CounterpartyNameAxis_9b703e22-bf7c-4f7e-8810-8b17e8b170bd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_9b703e22-bf7c-4f7e-8810-8b17e8b170bd_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_9b703e22-bf7c-4f7e-8810-8b17e8b170bd" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_9b703e22-bf7c-4f7e-8810-8b17e8b170bd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_f3ec93f5-d204-4a84-acaf-c01e0e08f66f" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_9b703e22-bf7c-4f7e-8810-8b17e8b170bd" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_f3ec93f5-d204-4a84-acaf-c01e0e08f66f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CounterpartyMember_c036c9b3-2080-4084-9a70-5721a646e088" xlink:href="bmrc-20231231.xsd#bmrc_CounterpartyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_f3ec93f5-d204-4a84-acaf-c01e0e08f66f" xlink:to="loc_bmrc_CounterpartyMember_c036c9b3-2080-4084-9a70-5721a646e088" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_08bcf0a6-677e-4651-a1eb-a8c42b9de40f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeAsset_08bcf0a6-677e-4651-a1eb-a8c42b9de40f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeAssetFairValueGrossLiability_7256a513-de0d-4303-9e70-a3f042673363" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeAssetFairValueGrossLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeAssetFairValueGrossLiability_7256a513-de0d-4303-9e70-a3f042673363" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAssetAmountNotOffsetAgainstCollateral_55fb7a4d-31a3-42cc-bff9-c3113c2770f1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeAssetAmountNotOffsetAgainstCollateral"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeAssetAmountNotOffsetAgainstCollateral_55fb7a4d-31a3-42cc-bff9-c3113c2770f1" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeCollateralObligationToReturnSecurities_73c1af30-0000-4d99-92f8-695950dafba9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeCollateralObligationToReturnSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeCollateralObligationToReturnSecurities_73c1af30-0000-4d99-92f8-695950dafba9" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeCollateralObligationToReturnCash_2b6b775e-e803-416f-8e58-313a8f357e48" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeCollateralObligationToReturnCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeCollateralObligationToReturnCash_2b6b775e-e803-416f-8e58-313a8f357e48" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeAssetAmountOffsetAgainstCollateral_8e106ac7-596e-48c8-8039-063e5a53e0d0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeAssetAmountOffsetAgainstCollateral"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_6f3ef3b9-2a62-4d5f-bb0b-c56729554abb" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeAssetAmountOffsetAgainstCollateral_8e106ac7-596e-48c8-8039-063e5a53e0d0" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofLiabilitiesDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofLiabilitiesDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/DerivativeFinancialInstrumentsandHedgingActivitiesScheduleofOffsettingofLiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativesFairValueLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_95d4b3d5-ed4c-4205-8757-d7805613d342" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_95d4b3d5-ed4c-4205-8757-d7805613d342" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CounterpartyNameAxis_d905fb59-ea2b-4797-b4ac-385f0696ca9a" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CounterpartyNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValuesDerivativesBalanceSheetLocationByDerivativeContractTypeByHedgingDesignationTable_95d4b3d5-ed4c-4205-8757-d7805613d342" xlink:to="loc_srt_CounterpartyNameAxis_d905fb59-ea2b-4797-b4ac-385f0696ca9a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_d905fb59-ea2b-4797-b4ac-385f0696ca9a_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_d905fb59-ea2b-4797-b4ac-385f0696ca9a" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_d905fb59-ea2b-4797-b4ac-385f0696ca9a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_fcf775ef-e090-4265-a5c2-932b532ed149" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_d905fb59-ea2b-4797-b4ac-385f0696ca9a" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_fcf775ef-e090-4265-a5c2-932b532ed149" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CounterpartyMember_31be3f50-2dcd-47cf-a4f4-bcc318fbaeb7" xlink:href="bmrc-20231231.xsd#bmrc_CounterpartyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_fcf775ef-e090-4265-a5c2-932b532ed149" xlink:to="loc_bmrc_CounterpartyMember_31be3f50-2dcd-47cf-a4f4-bcc318fbaeb7" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_8228f3bb-f36c-4efa-a81f-eeb15d0a4df9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeLiability_8228f3bb-f36c-4efa-a81f-eeb15d0a4df9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilityFairValueGrossAsset_f60be036-f456-4bd1-83f7-05de26a28ab3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilityFairValueGrossAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeLiabilityFairValueGrossAsset_f60be036-f456-4bd1-83f7-05de26a28ab3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountNotOffsetAgainstCollateral_767ad93f-94da-41a3-a13e-3cc4ebc812e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountNotOffsetAgainstCollateral"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountNotOffsetAgainstCollateral_767ad93f-94da-41a3-a13e-3cc4ebc812e0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeCollateralRightToReclaimSecurities_f8072da5-bf67-4c41-a65a-df792a68e889" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeCollateralRightToReclaimSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeCollateralRightToReclaimSecurities_f8072da5-bf67-4c41-a65a-df792a68e889" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeCollateralRightToReclaimCash_2ef59973-29c8-4a5b-a1c9-7929314882b0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeCollateralRightToReclaimCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeCollateralRightToReclaimCash_2ef59973-29c8-4a5b-a1c9-7929314882b0" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountOffsetAgainstCollateral_d0fe30c8-e671-4399-ab5f-d9afbbd2cb95" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountOffsetAgainstCollateral"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DerivativesFairValueLineItems_d3d8dd16-13cd-4fd2-83d1-5a24b7a0e42d" xlink:to="loc_us-gaap_DerivativeFairValueOfDerivativeLiabilityAmountOffsetAgainstCollateral_d0fe30c8-e671-4399-ab5f-d9afbbd2cb95" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/RegulatoryMattersScheduleofCapitalAdequacyRatiosDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#RegulatoryMattersScheduleofCapitalAdequacyRatiosDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/RegulatoryMattersScheduleofCapitalAdequacyRatiosDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsTable_91133d92-2c8d-4a89-8228-8dde3f159ae2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_ScheduleOfComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsTable_91133d92-2c8d-4a89-8228-8dde3f159ae2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesAxis_cdad34fb-3dfa-47a2-b710-932b6cdadef4" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsTable_91133d92-2c8d-4a89-8228-8dde3f159ae2" xlink:to="loc_srt_ConsolidatedEntitiesAxis_cdad34fb-3dfa-47a2-b710-932b6cdadef4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_cdad34fb-3dfa-47a2-b710-932b6cdadef4_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_cdad34fb-3dfa-47a2-b710-932b6cdadef4" xlink:to="loc_srt_ConsolidatedEntitiesDomain_cdad34fb-3dfa-47a2-b710-932b6cdadef4_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_d5935eb9-a9f1-450d-9212-cf20c4ccd57f" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_cdad34fb-3dfa-47a2-b710-932b6cdadef4" xlink:to="loc_srt_ConsolidatedEntitiesDomain_d5935eb9-a9f1-450d-9212-cf20c4ccd57f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ParentCompanyMember_ee1be1ec-ef1a-4671-8b2f-eb157e0fdf06" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ParentCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_d5935eb9-a9f1-450d-9212-cf20c4ccd57f" xlink:to="loc_srt_ParentCompanyMember_ee1be1ec-ef1a-4671-8b2f-eb157e0fdf06" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_SubsidiariesMember_ed12ad8f-b4a9-4130-8a62-37fe3708001d" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_SubsidiariesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_d5935eb9-a9f1-450d-9212-cf20c4ccd57f" xlink:to="loc_srt_SubsidiariesMember_ed12ad8f-b4a9-4130-8a62-37fe3708001d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Capital_9c85b0e4-8703-4ac1-bd0a-764f4ca0a54c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_Capital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_Capital_9c85b0e4-8703-4ac1-bd0a-764f4ca0a54c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalToRiskWeightedAssets_6366eb99-b937-45b4-9264-0fa4a78e9b81" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CapitalToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_CapitalToRiskWeightedAssets_6366eb99-b937-45b4-9264-0fa4a78e9b81" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalRequiredForCapitalAdequacy_d60f322b-ba60-466a-9ca7-47d145b96741" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CapitalRequiredForCapitalAdequacy"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_CapitalRequiredForCapitalAdequacy_d60f322b-ba60-466a-9ca7-47d145b96741" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalRequiredForCapitalAdequacyToRiskWeightedAssets_2fd1cb35-d22a-4f93-8510-e179ac302338" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CapitalRequiredForCapitalAdequacyToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_CapitalRequiredForCapitalAdequacyToRiskWeightedAssets_2fd1cb35-d22a-4f93-8510-e179ac302338" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalRequiredToBeWellCapitalized_2dc00365-43b5-4846-9638-c353f3b48e6d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CapitalRequiredToBeWellCapitalized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_CapitalRequiredToBeWellCapitalized_2dc00365-43b5-4846-9638-c353f3b48e6d" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CapitalRequiredToBeWellCapitalizedToRiskWeightedAssets_bbb3b846-7586-460a-90f7-2ee324c4b812" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CapitalRequiredToBeWellCapitalizedToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_CapitalRequiredToBeWellCapitalizedToRiskWeightedAssets_bbb3b846-7586-460a-90f7-2ee324c4b812" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneRiskBasedCapital_7862c7a6-4740-4c17-8351-4317fba00164" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneRiskBasedCapital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneRiskBasedCapital_7862c7a6-4740-4c17-8351-4317fba00164" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneRiskBasedCapitalToRiskWeightedAssets_5978b99f-2f39-47c9-b3d7-07e7e002e18c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneRiskBasedCapitalToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneRiskBasedCapitalToRiskWeightedAssets_5978b99f-2f39-47c9-b3d7-07e7e002e18c" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneRiskBasedCapitalRequiredForCapitalAdequacy_a9845c7b-995e-41b7-94fc-1791e7478064" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneRiskBasedCapitalRequiredForCapitalAdequacy"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneRiskBasedCapitalRequiredForCapitalAdequacy_a9845c7b-995e-41b7-94fc-1791e7478064" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBufferToRiskWeightedAssets_3e5c9b33-3c0e-4a66-a365-4635a2d837a1" xlink:href="bmrc-20231231.xsd#bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBufferToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBufferToRiskWeightedAssets_3e5c9b33-3c0e-4a66-a365-4635a2d837a1" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBuffer_ece19ece-fdcf-47c1-a666-8ee7ab6134ab" xlink:href="bmrc-20231231.xsd#bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBuffer"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneRiskBasedCapitalRequiredForCapitalAdequacyWithBuffer_ece19ece-fdcf-47c1-a666-8ee7ab6134ab" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneRiskBasedCapitalRequiredToBeWellCapitalizedToRiskWeightedAssets_90b4987a-da09-49c9-8b99-649f739b2fc3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneRiskBasedCapitalRequiredToBeWellCapitalizedToRiskWeightedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneRiskBasedCapitalRequiredToBeWellCapitalizedToRiskWeightedAssets_90b4987a-da09-49c9-8b99-649f739b2fc3" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapital_28a8d4c7-6b54-4d65-a0aa-7835eda86acd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapital"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapital_28a8d4c7-6b54-4d65-a0aa-7835eda86acd" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapitalToAverageAssets_578efbf4-2c26-41ec-8a1b-45edb4cc2deb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapitalToAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapitalToAverageAssets_578efbf4-2c26-41ec-8a1b-45edb4cc2deb" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacy_148ce29f-b9f7-4466-9604-f252d6d3652a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacy"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacy_148ce29f-b9f7-4466-9604-f252d6d3652a" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacyToAverageAssets_ea66cb73-3cfe-4cbe-b3d4-85505595f958" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacyToAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapitalRequiredForCapitalAdequacyToAverageAssets_ea66cb73-3cfe-4cbe-b3d4-85505595f958" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalized_857f6eb7-8788-49ff-b2be-c5be2a958be5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalized_857f6eb7-8788-49ff-b2be-c5be2a958be5" xlink:type="arc" order="16"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalizedToAverageAssets_1ccea5c4-0d89-4be8-8f8f-d2d3a5db7003" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalizedToAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_us-gaap_TierOneLeverageCapitalRequiredToBeWellCapitalizedToAverageAssets_1ccea5c4-0d89-4be8-8f8f-d2d3a5db7003" xlink:type="arc" order="17"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquity_749d5f93-d375-43b1-98c7-1b95e80665ed" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquity_749d5f93-d375-43b1-98c7-1b95e80665ed" xlink:type="arc" order="18"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquityToAverageAssets_0aa6340b-d51a-4246-81bc-091e135b0481" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquityToAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquityToAverageAssets_0aa6340b-d51a-4246-81bc-091e135b0481" xlink:type="arc" order="19"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquityRequiredforCapitalAdequacy_3b5d233a-c439-4bec-95e8-d8e9f5a70a3e" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquityRequiredforCapitalAdequacy"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquityRequiredforCapitalAdequacy_3b5d233a-c439-4bec-95e8-d8e9f5a70a3e" xlink:type="arc" order="20"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquityRequiredforCapitalAdequacytoAverageAssets_c6bd3d96-6796-49ef-9d0b-0c37077e9485" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquityRequiredforCapitalAdequacytoAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquityRequiredforCapitalAdequacytoAverageAssets_c6bd3d96-6796-49ef-9d0b-0c37077e9485" xlink:type="arc" order="21"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquityRequiredtobeWellCapitalized_a7b4bd69-a269-4a50-832f-71f7ab268fe2" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquityRequiredtobeWellCapitalized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquityRequiredtobeWellCapitalized_a7b4bd69-a269-4a50-832f-71f7ab268fe2" xlink:type="arc" order="22"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TierOneCommonEquityRequiredtobeWellCapitalizedtoAverageAssets_f1cee865-e40b-47aa-ada6-8c7368d9d1cd" xlink:href="bmrc-20231231.xsd#bmrc_TierOneCommonEquityRequiredtobeWellCapitalizedtoAverageAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ComplianceWithRegulatoryCapitalRequirementsUnderBankingRegulationsLineItems_226fb59a-6a03-465f-b472-cb0aa94a4907" xlink:to="loc_bmrc_TierOneCommonEquityRequiredtobeWellCapitalizedtoAverageAssets_f1cee865-e40b-47aa-ada6-8c7368d9d1cd" xlink:type="arc" order="23"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/FinancialInstrumentswithOffBalanceSheetRiskDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#FinancialInstrumentswithOffBalanceSheetRiskDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/FinancialInstrumentswithOffBalanceSheetRiskDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_dc6a1aeb-2707-49e6-901a-6a0d73cc00d2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_dc6a1aeb-2707-49e6-901a-6a0d73cc00d2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_99c652c3-16de-4e97-a797-60b0a5bbe055" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_dc6a1aeb-2707-49e6-901a-6a0d73cc00d2" xlink:to="loc_us-gaap_FinancialInstrumentAxis_99c652c3-16de-4e97-a797-60b0a5bbe055" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_99c652c3-16de-4e97-a797-60b0a5bbe055_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_99c652c3-16de-4e97-a797-60b0a5bbe055" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_99c652c3-16de-4e97-a797-60b0a5bbe055_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_99c652c3-16de-4e97-a797-60b0a5bbe055" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CommercialLinesOfCreditMember_3f6cedc0-da48-4002-885b-c2737a71373e" xlink:href="bmrc-20231231.xsd#bmrc_CommercialLinesOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_bmrc_CommercialLinesOfCreditMember_3f6cedc0-da48-4002-885b-c2737a71373e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_HomeEquityMember_6f3e021e-43f0-4986-bcbb-8872c8535fe7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_HomeEquityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_us-gaap_HomeEquityMember_6f3e021e-43f0-4986-bcbb-8872c8535fe7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_UndisbursedConstructionLoansMember_ef0fe5c1-aed0-4e91-9b5e-3c58e2d02243" xlink:href="bmrc-20231231.xsd#bmrc_UndisbursedConstructionLoansMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_bmrc_UndisbursedConstructionLoansMember_ef0fe5c1-aed0-4e91-9b5e-3c58e2d02243" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ConsumerAndOtherLinesOfCreditMember_52d4c8c7-93e1-4227-aa94-f71abba9053c" xlink:href="bmrc-20231231.xsd#bmrc_ConsumerAndOtherLinesOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_bmrc_ConsumerAndOtherLinesOfCreditMember_52d4c8c7-93e1-4227-aa94-f71abba9053c" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialStandbyLetterOfCreditMember_7233951f-3477-4728-b3f4-d292c4c4ffc1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialStandbyLetterOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_us-gaap_FinancialStandbyLetterOfCreditMember_7233951f-3477-4728-b3f4-d292c4c4ffc1" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LinesOfCreditAndLettersOfCreditUnusedCommitmentsMember_31d03c0e-03c4-4280-9e82-e53f58c02983" xlink:href="bmrc-20231231.xsd#bmrc_LinesOfCreditAndLettersOfCreditUnusedCommitmentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_35751035-b432-45ba-9df6-ac4a30da2a66" xlink:to="loc_bmrc_LinesOfCreditAndLettersOfCreditUnusedCommitmentsMember_31d03c0e-03c4-4280-9e82-e53f58c02983" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_OffBalanceSheetArrangementsLiabilitiesCurrentExposure_146ebe17-7fe9-4378-9a2b-23050dc14887" xlink:href="bmrc-20231231.xsd#bmrc_OffBalanceSheetArrangementsLiabilitiesCurrentExposure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_bmrc_OffBalanceSheetArrangementsLiabilitiesCurrentExposure_146ebe17-7fe9-4378-9a2b-23050dc14887" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInNextTwelveMonths_546de0ce-a235-48e7-9bc9-0316c09fbc92" xlink:href="bmrc-20231231.xsd#bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInNextTwelveMonths"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInNextTwelveMonths_546de0ce-a235-48e7-9bc9-0316c09fbc92" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInYearTwoThroughSeven_68e0bf70-5a1e-493e-ae59-a41388a48dfa" xlink:href="bmrc-20231231.xsd#bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInYearTwoThroughSeven"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringInYearTwoThroughSeven_68e0bf70-5a1e-493e-ae59-a41388a48dfa" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringAfterYearSeven_a3e4aea3-0f92-4042-acaa-63f8c5367e05" xlink:href="bmrc-20231231.xsd#bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringAfterYearSeven"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_bmrc_LoanCommitmentsAndStandbyLettersOfCreditPercentageExpiringAfterYearSeven_a3e4aea3-0f92-4042-acaa-63f8c5367e05" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AllowanceForOffBalanceSheetCommitments_789ad6fa-7754-42df-8bdf-ffcc6f7c429c" xlink:href="bmrc-20231231.xsd#bmrc_AllowanceForOffBalanceSheetCommitments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_896b2a66-4d52-47c6-b2e0-2bfa6d52d370" xlink:to="loc_bmrc_AllowanceForOffBalanceSheetCommitments_789ad6fa-7754-42df-8bdf-ffcc6f7c429c" xlink:type="arc" order="4"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUncosolidatedStatementsofConditionDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUncosolidatedStatementsofConditionDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUncosolidatedStatementsofConditionDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_srt_CondensedFinancialStatementsCaptionsLineItems_8453b72d-6dd5-47c0-bde2-016a234194fd" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CondensedFinancialStatementsCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScheduleOfCondensedFinancialStatementsTable_da6b67ba-a129-441a-99d3-12ba7523b8dd" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScheduleOfCondensedFinancialStatementsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_8453b72d-6dd5-47c0-bde2-016a234194fd" xlink:to="loc_srt_ScheduleOfCondensedFinancialStatementsTable_da6b67ba-a129-441a-99d3-12ba7523b8dd" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesAxis_daa575ef-187e-42c0-8eb9-4a452f5e05a2" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ScheduleOfCondensedFinancialStatementsTable_da6b67ba-a129-441a-99d3-12ba7523b8dd" xlink:to="loc_srt_ConsolidatedEntitiesAxis_daa575ef-187e-42c0-8eb9-4a452f5e05a2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_daa575ef-187e-42c0-8eb9-4a452f5e05a2_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_daa575ef-187e-42c0-8eb9-4a452f5e05a2" xlink:to="loc_srt_ConsolidatedEntitiesDomain_daa575ef-187e-42c0-8eb9-4a452f5e05a2_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_a253909d-e490-4f40-884d-0bea69eb3763" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_daa575ef-187e-42c0-8eb9-4a452f5e05a2" xlink:to="loc_srt_ConsolidatedEntitiesDomain_a253909d-e490-4f40-884d-0bea69eb3763" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ParentCompanyMember_50712f94-8a84-4266-9d5b-e9f372ea6802" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ParentCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_a253909d-e490-4f40-884d-0bea69eb3763" xlink:to="loc_srt_ParentCompanyMember_50712f94-8a84-4266-9d5b-e9f372ea6802" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AssetsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_8453b72d-6dd5-47c0-bde2-016a234194fd" xlink:to="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CashAndDueFromSubsidiary_bac6d442-623e-4ff1-8a55-21ec8a4b90fb" xlink:href="bmrc-20231231.xsd#bmrc_CashAndDueFromSubsidiary"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:to="loc_bmrc_CashAndDueFromSubsidiary_bac6d442-623e-4ff1-8a55-21ec8a4b90fb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_InvestmentInSubsidiary_02e0fe9f-96d7-42a8-9d7b-64932031acb7" xlink:href="bmrc-20231231.xsd#bmrc_InvestmentInSubsidiary"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:to="loc_bmrc_InvestmentInSubsidiary_02e0fe9f-96d7-42a8-9d7b-64932031acb7" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_0ab8d8ef-911d-4f8f-9372-e2a21619e1d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:to="loc_us-gaap_OtherAssets_0ab8d8ef-911d-4f8f-9372-e2a21619e1d8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_8d69799d-799e-4968-85b8-91f88e717ed9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_Assets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_3c0f3ef9-cd6a-4a2f-adf4-baf78ea36839" xlink:to="loc_us-gaap_Assets_8d69799d-799e-4968-85b8-91f88e717ed9" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LiabilitiesAndStockholdersEquityAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_8453b72d-6dd5-47c0-bde2-016a234194fd" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrentAndNoncurrent_370716d6-d25f-4971-bbac-04cd90015a30" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccruedLiabilitiesCurrentAndNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrentAndNoncurrent_370716d6-d25f-4971-bbac-04cd90015a30" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_ba915543-0470-4f60-81d6-696e92d97d31" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:to="loc_us-gaap_OtherLiabilities_ba915543-0470-4f60-81d6-696e92d97d31" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_12ca7660-fcfe-4b9b-9263-4053834cd146" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_Liabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:to="loc_us-gaap_Liabilities_12ca7660-fcfe-4b9b-9263-4053834cd146" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_ef4dcca9-fa07-44c6-a8b9-439e6d89360b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:to="loc_us-gaap_StockholdersEquity_ef4dcca9-fa07-44c6-a8b9-439e6d89360b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_49570cca-377b-41ee-8717-bbd1846aeb1e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquityAbstract_b6179fa9-0a71-4c0a-9edd-72d89bb0de6a" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquity_49570cca-377b-41ee-8717-bbd1846aeb1e" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofIncomeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofIncomeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofIncomeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CondensedFinancialStatementsCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScheduleOfCondensedFinancialStatementsTable_4bb2cc03-abbd-41f0-888f-f49d767bc8ca" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScheduleOfCondensedFinancialStatementsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_srt_ScheduleOfCondensedFinancialStatementsTable_4bb2cc03-abbd-41f0-888f-f49d767bc8ca" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesAxis_44300400-1474-4256-beaf-bdaa01bbcde7" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ScheduleOfCondensedFinancialStatementsTable_4bb2cc03-abbd-41f0-888f-f49d767bc8ca" xlink:to="loc_srt_ConsolidatedEntitiesAxis_44300400-1474-4256-beaf-bdaa01bbcde7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_44300400-1474-4256-beaf-bdaa01bbcde7_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_44300400-1474-4256-beaf-bdaa01bbcde7" xlink:to="loc_srt_ConsolidatedEntitiesDomain_44300400-1474-4256-beaf-bdaa01bbcde7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_cb463b0c-ed45-44fc-8ae3-7fd338e8f99c" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_44300400-1474-4256-beaf-bdaa01bbcde7" xlink:to="loc_srt_ConsolidatedEntitiesDomain_cb463b0c-ed45-44fc-8ae3-7fd338e8f99c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ParentCompanyMember_7f049095-b52b-43de-905d-330a05dad1d2" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ParentCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_cb463b0c-ed45-44fc-8ae3-7fd338e8f99c" xlink:to="loc_srt_ParentCompanyMember_7f049095-b52b-43de-905d-330a05dad1d2" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLossAbstract_c273583f-822b-49f5-8b5d-4f195c0e8133" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingIncomeLossAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_us-gaap_OperatingIncomeLossAbstract_c273583f-822b-49f5-8b5d-4f195c0e8133" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DividendIncomeFromSubsidiariesOperating_d1fac041-ecda-4fac-8da6-399d08de773b" xlink:href="bmrc-20231231.xsd#bmrc_DividendIncomeFromSubsidiariesOperating"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingIncomeLossAbstract_c273583f-822b-49f5-8b5d-4f195c0e8133" xlink:to="loc_bmrc_DividendIncomeFromSubsidiariesOperating_d1fac041-ecda-4fac-8da6-399d08de773b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_MiscellaneousIncome_b6e5790e-88d4-4f23-9528-e0e8ad4ec069" xlink:href="bmrc-20231231.xsd#bmrc_MiscellaneousIncome"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingIncomeLossAbstract_c273583f-822b-49f5-8b5d-4f195c0e8133" xlink:to="loc_bmrc_MiscellaneousIncome_b6e5790e-88d4-4f23-9528-e0e8ad4ec069" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromSubsidiariesBeforeTax_e7bbb32d-acc9-4cfd-bc24-bda127eeb410" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeLossFromSubsidiariesBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingIncomeLossAbstract_c273583f-822b-49f5-8b5d-4f195c0e8133" xlink:to="loc_us-gaap_IncomeLossFromSubsidiariesBeforeTax_e7bbb32d-acc9-4cfd-bc24-bda127eeb410" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpensesAbstract_1254e776-6ae6-4962-832a-c03c031caf9e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CostsAndExpensesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_us-gaap_CostsAndExpensesAbstract_1254e776-6ae6-4962-832a-c03c031caf9e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_f9595c5f-b73a-4e84-aed3-1a990ac51a5f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_1254e776-6ae6-4962-832a-c03c031caf9e" xlink:to="loc_us-gaap_InterestExpense_f9595c5f-b73a-4e84-aed3-1a990ac51a5f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NoninterestExpense_6b702701-4516-47ee-b5e5-d13653e45c08" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NoninterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_1254e776-6ae6-4962-832a-c03c031caf9e" xlink:to="loc_us-gaap_NoninterestExpense_6b702701-4516-47ee-b5e5-d13653e45c08" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_TotalExpense_015af7bf-31d4-4d92-996a-989ffd22d125" xlink:href="bmrc-20231231.xsd#bmrc_TotalExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_1254e776-6ae6-4962-832a-c03c031caf9e" xlink:to="loc_bmrc_TotalExpense_015af7bf-31d4-4d92-996a-989ffd22d125" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_IncomeLossBeforeIncomeTaxesAndEquityInUndistributedNetIncomeOfSubsidiary_ea37eb17-45be-4072-ba13-565cb2c99739" xlink:href="bmrc-20231231.xsd#bmrc_IncomeLossBeforeIncomeTaxesAndEquityInUndistributedNetIncomeOfSubsidiary"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_bmrc_IncomeLossBeforeIncomeTaxesAndEquityInUndistributedNetIncomeOfSubsidiary_ea37eb17-45be-4072-ba13-565cb2c99739" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_61bafc20-27c5-478f-bb0e-77a56e1c8389" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_61bafc20-27c5-478f-bb0e-77a56e1c8389" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_IncomeBeforeEquityInUndistributedEarningsOfSubsidiaries_61205462-7deb-4f89-b0a9-b1f1f7c64daa" xlink:href="bmrc-20231231.xsd#bmrc_IncomeBeforeEquityInUndistributedEarningsOfSubsidiaries"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_bmrc_IncomeBeforeEquityInUndistributedEarningsOfSubsidiaries_61205462-7deb-4f89-b0a9-b1f1f7c64daa" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_EquityInUndistributedNetIncomeOfSubsidiary_1618025f-1f81-4d5e-860d-32fd7de5d099" xlink:href="bmrc-20231231.xsd#bmrc_EquityInUndistributedNetIncomeOfSubsidiary"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_bmrc_EquityInUndistributedNetIncomeOfSubsidiary_1618025f-1f81-4d5e-860d-32fd7de5d099" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_6df090c8-f7cc-40df-9766-b880a15b1640" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_5c16e489-f497-4aa2-82dc-f630caf1d55b" xlink:to="loc_us-gaap_NetIncomeLoss_6df090c8-f7cc-40df-9766-b880a15b1640" xlink:type="arc" order="6"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofCashFlowsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofCashFlowsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/CondensedBankofMarinBancorpParentOnlyFinancialStatementsCondensedUnconsolidatedStatementsofCashFlowsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CondensedFinancialStatementsCaptionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScheduleOfCondensedFinancialStatementsTable_1d791505-9732-434d-b8a8-bf0917e1dc59" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScheduleOfCondensedFinancialStatementsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_srt_ScheduleOfCondensedFinancialStatementsTable_1d791505-9732-434d-b8a8-bf0917e1dc59" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesAxis_d37f583d-b95a-42a5-9030-2c4cf4cd55f3" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ScheduleOfCondensedFinancialStatementsTable_1d791505-9732-434d-b8a8-bf0917e1dc59" xlink:to="loc_srt_ConsolidatedEntitiesAxis_d37f583d-b95a-42a5-9030-2c4cf4cd55f3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_d37f583d-b95a-42a5-9030-2c4cf4cd55f3_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_d37f583d-b95a-42a5-9030-2c4cf4cd55f3" xlink:to="loc_srt_ConsolidatedEntitiesDomain_d37f583d-b95a-42a5-9030-2c4cf4cd55f3_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ConsolidatedEntitiesDomain_15fc1362-e2c6-46aa-af5a-c78386cbe23d" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ConsolidatedEntitiesDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_d37f583d-b95a-42a5-9030-2c4cf4cd55f3" xlink:to="loc_srt_ConsolidatedEntitiesDomain_15fc1362-e2c6-46aa-af5a-c78386cbe23d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ParentCompanyMember_235b0b1f-b5ff-46f4-8845-e80687213dcc" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ParentCompanyMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_15fc1362-e2c6-46aa-af5a-c78386cbe23d" xlink:to="loc_srt_ParentCompanyMember_235b0b1f-b5ff-46f4-8845-e80687213dcc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_5c0d3725-b2a2-43b3-852d-e6b31bf29188" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_us-gaap_NetIncomeLoss_5c0d3725-b2a2-43b3-852d-e6b31bf29188" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_EquityinUndistributedandDistributedEarningsofSubsidiaryNetofDividendsReceived_d4cf21c9-378f-471b-a9bc-3ff9afca090b" xlink:href="bmrc-20231231.xsd#bmrc_EquityinUndistributedandDistributedEarningsofSubsidiaryNetofDividendsReceived"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_bmrc_EquityinUndistributedandDistributedEarningsofSubsidiaryNetofDividendsReceived_d4cf21c9-378f-471b-a9bc-3ff9afca090b" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfDebtDiscountPremium_27fec69b-fcb1-4c41-92b8-8b1730f5ccb7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationOfDebtDiscountPremium"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_us-gaap_AmortizationOfDebtDiscountPremium_27fec69b-fcb1-4c41-92b8-8b1730f5ccb7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CompensationExpenseCommonStockForDirectorFees_313be397-e2ba-4243-862d-0dd24bfa7203" xlink:href="bmrc-20231231.xsd#bmrc_CompensationExpenseCommonStockForDirectorFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_bmrc_CompensationExpenseCommonStockForDirectorFees_313be397-e2ba-4243-862d-0dd24bfa7203" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssets_dc510cbd-c334-45f8-a54c-a8c70280f318" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInOtherOperatingAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssets_dc510cbd-c334-45f8-a54c-a8c70280f318" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingLiabilities_41067199-089d-423f-8769-dbf21435598c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInOtherOperatingLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingLiabilities_41067199-089d-423f-8769-dbf21435598c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_8a457684-a678-4ff4-99f6-ca56829783b3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_6bcfbfeb-e298-4cb1-98f5-8efc1e38a8f3" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_8a457684-a678-4ff4-99f6-ca56829783b3" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_f3d91c70-5f73-4a13-befd-603cf3559c32" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_f3d91c70-5f73-4a13-befd-603cf3559c32" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_CapitalContributionToSubsidiaryBank_a753ef0f-f949-46f8-b857-2d71f84dfc3e" xlink:href="bmrc-20231231.xsd#bmrc_CapitalContributionToSubsidiaryBank"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_f3d91c70-5f73-4a13-befd-603cf3559c32" xlink:to="loc_bmrc_CapitalContributionToSubsidiaryBank_a753ef0f-f949-46f8-b857-2d71f84dfc3e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_9009750b-ae05-4e3c-81cb-b3ceaaabeabe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_f3d91c70-5f73-4a13-befd-603cf3559c32" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_9009750b-ae05-4e3c-81cb-b3ceaaabeabe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfSubordinatedDebt_bb0cbb6f-442c-4414-8ef9-40ccdec6bfbf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RepaymentsOfSubordinatedDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_us-gaap_RepaymentsOfSubordinatedDebt_bb0cbb6f-442c-4414-8ef9-40ccdec6bfbf" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d788573d-fe46-4e4e-b73d-8e8e8f096627" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d788573d-fe46-4e4e-b73d-8e8e8f096627" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDividendsCommonStock_67eb1a78-a45d-48ac-9e99-c3083d363d45" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PaymentsOfDividendsCommonStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_us-gaap_PaymentsOfDividendsCommonStock_67eb1a78-a45d-48ac-9e99-c3083d363d45" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfEquity_6855ee64-3a47-47c5-8eea-51554b586c75" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PaymentsForRepurchaseOfEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfEquity_6855ee64-3a47-47c5-8eea-51554b586c75" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ProceedsFromStockOptionsExercisedAndEmployeeStockPurchases_894d084e-7131-42a5-bc04-cedfc4c00f13" xlink:href="bmrc-20231231.xsd#bmrc_ProceedsFromStockOptionsExercisedAndEmployeeStockPurchases"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_bmrc_ProceedsFromStockOptionsExercisedAndEmployeeStockPurchases_894d084e-7131-42a5-bc04-cedfc4c00f13" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_690dda56-37a2-4727-838c-34d26ddc94cd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_fa06d1fa-ecb9-443b-800c-597ebb683712" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_690dda56-37a2-4727-838c-34d26ddc94cd" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_dc2f0a8c-b606-455a-820f-60002af03d0e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_dc2f0a8c-b606-455a-820f-60002af03d0e" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_31cc1620-8389-4ff7-b83e-a5ecef60b3a8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_31cc1620-8389-4ff7-b83e-a5ecef60b3a8" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_724aae79-e673-42e7-b3a0-2cc3a35e3514" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedInPaymentOfDirectorFees_c33198cd-b117-4019-97bc-a71e97dc6fe4" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedInPaymentOfDirectorFees"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_bmrc_StockIssuedInPaymentOfDirectorFees_c33198cd-b117-4019-97bc-a71e97dc6fe4" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_RepurchaseOfStockNotYetSettled_192121ac-1b86-4148-a542-0812e25899b7" xlink:href="bmrc-20231231.xsd#bmrc_RepurchaseOfStockNotYetSettled"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_bmrc_RepurchaseOfStockNotYetSettled_192121ac-1b86-4148-a542-0812e25899b7" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_StockIssuedInPaymentOfDirectorFeesAndToESOP_242ffe94-12ca-416b-b642-1688769a0f10" xlink:href="bmrc-20231231.xsd#bmrc_StockIssuedInPaymentOfDirectorFeesAndToESOP"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_1da5b35a-28c8-4d6b-a470-6c983b22b448" xlink:to="loc_bmrc_StockIssuedInPaymentOfDirectorFeesAndToESOP_242ffe94-12ca-416b-b642-1688769a0f10" xlink:type="arc" order="8"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/MergerNarrativeDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#MergerNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/MergerNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable_c370164b-3fb5-4479-a788-a2171bd26d4f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable_c370164b-3fb5-4479-a788-a2171bd26d4f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_c88b7c15-a960-49c0-8e25-ad0bf26b7336" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable_c370164b-3fb5-4479-a788-a2171bd26d4f" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_c88b7c15-a960-49c0-8e25-ad0bf26b7336" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_c88b7c15-a960-49c0-8e25-ad0bf26b7336_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_c88b7c15-a960-49c0-8e25-ad0bf26b7336" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_c88b7c15-a960-49c0-8e25-ad0bf26b7336_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_c6de1d41-2510-4984-a20b-f5fc0284b838" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_c88b7c15-a960-49c0-8e25-ad0bf26b7336" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_c6de1d41-2510-4984-a20b-f5fc0284b838" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AmericanRiverBankARBMergerMember_1c35850c-d110-4a87-bb0c-eb49e87ac741" xlink:href="bmrc-20231231.xsd#bmrc_AmericanRiverBankARBMergerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_c6de1d41-2510-4984-a20b-f5fc0284b838" xlink:to="loc_bmrc_AmericanRiverBankARBMergerMember_1c35850c-d110-4a87-bb0c-eb49e87ac741" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_cc7c7a2c-7605-45b2-ab19-60b1fbc06496" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable_c370164b-3fb5-4479-a788-a2171bd26d4f" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_cc7c7a2c-7605-45b2-ab19-60b1fbc06496" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_cc7c7a2c-7605-45b2-ab19-60b1fbc06496_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_cc7c7a2c-7605-45b2-ab19-60b1fbc06496" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_cc7c7a2c-7605-45b2-ab19-60b1fbc06496_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_0291f7eb-9b3d-491d-83c9-996bf6d41a75" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_cc7c7a2c-7605-45b2-ab19-60b1fbc06496" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_0291f7eb-9b3d-491d-83c9-996bf6d41a75" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_4f1861a8-b47b-4cef-8560-db7b2a0a7602" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_0291f7eb-9b3d-491d-83c9-996bf6d41a75" xlink:to="loc_us-gaap_CommonStockMember_4f1861a8-b47b-4cef-8560-db7b2a0a7602" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_LegalEntityAxis_62e14886-bb04-4eca-97bc-5b8e4f7583bd" xlink:href="https://xbrl.sec.gov/dei/2023/dei-2023.xsd#dei_LegalEntityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsTable_c370164b-3fb5-4479-a788-a2171bd26d4f" xlink:to="loc_dei_LegalEntityAxis_62e14886-bb04-4eca-97bc-5b8e4f7583bd" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityDomain_62e14886-bb04-4eca-97bc-5b8e4f7583bd_default" xlink:href="https://xbrl.sec.gov/dei/2023/dei-2023.xsd#dei_EntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_dei_LegalEntityAxis_62e14886-bb04-4eca-97bc-5b8e4f7583bd" xlink:to="loc_dei_EntityDomain_62e14886-bb04-4eca-97bc-5b8e4f7583bd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_dei_EntityDomain_64c7bbaf-36fa-42b7-ad5a-9a4eb1b2d5b3" xlink:href="https://xbrl.sec.gov/dei/2023/dei-2023.xsd#dei_EntityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_dei_LegalEntityAxis_62e14886-bb04-4eca-97bc-5b8e4f7583bd" xlink:to="loc_dei_EntityDomain_64c7bbaf-36fa-42b7-ad5a-9a4eb1b2d5b3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BankOfMarinMember_0e247886-6f42-4025-b2b1-c01192cd8ee5" xlink:href="bmrc-20231231.xsd#bmrc_BankOfMarinMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityDomain_64c7bbaf-36fa-42b7-ad5a-9a4eb1b2d5b3" xlink:to="loc_bmrc_BankOfMarinMember_0e247886-6f42-4025-b2b1-c01192cd8ee5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets_7291cf60-147f-4f05-84a8-1f1fb18ad97f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedAssets_7291cf60-147f-4f05-84a8-1f1fb18ad97f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsMarketableSecurities_50ea90c8-91cb-4121-8158-5fc4559e48ab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsMarketableSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedCurrentAssetsMarketableSecurities_50ea90c8-91cb-4121-8158-5fc4559e48ab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLoansAtAmortizedCost_2714db9c-1594-47c2-b2f4-cd7f5f50de64" xlink:href="bmrc-20231231.xsd#bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLoansAtAmortizedCost"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLoansAtAmortizedCost_2714db9c-1594-47c2-b2f4-cd7f5f50de64" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities_4178114d-45f4-49c3-bf88-c09ae67e1bab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedLiabilities_4178114d-45f4-49c3-bf88-c09ae67e1bab" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeposits_f161b90a-7ac4-4974-a07f-f6cc2bcddb56" xlink:href="bmrc-20231231.xsd#bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeposits"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_bmrc_BusinessCombinationRecognizedIdentifiableAssetsAcquiredAndLiabilitiesAssumedDeposits_f161b90a-7ac4-4974-a07f-f6cc2bcddb56" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BusinessCombinationFixedExchangeRatio_834d95a5-ad3c-41f0-ad6b-a4851a429ae3" xlink:href="bmrc-20231231.xsd#bmrc_BusinessCombinationFixedExchangeRatio"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_bmrc_BusinessCombinationFixedExchangeRatio_834d95a5-ad3c-41f0-ad6b-a4851a429ae3" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionEquityInterestsIssuedOrIssuableNumberOfSharesIssued_757a4a27-3b5a-4fd2-87a1-541a696b9b36" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionEquityInterestsIssuedOrIssuableNumberOfSharesIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessAcquisitionEquityInterestsIssuedOrIssuableNumberOfSharesIssued_757a4a27-3b5a-4fd2-87a1-541a696b9b36" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_7ceeb005-c4e6-46d9-8053-d26358882c2e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_Goodwill"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_Goodwill_7ceeb005-c4e6-46d9-8053-d26358882c2e" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_a5248962-28d9-4dd2-850f-f5c1fb3e6af6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_a5248962-28d9-4dd2-850f-f5c1fb3e6af6" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_3cef46ba-72ca-4137-b2ac-637233736e03" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessCombinationSeparatelyRecognizedTransactionsLineItems_e8b375e0-3480-41d0-b682-226002305b64" xlink:to="loc_us-gaap_BusinessCombinationRecognizedIdentifiableAssetsAcquiredGoodwillAndLiabilitiesAssumedNet_3cef46ba-72ca-4137-b2ac-637233736e03" xlink:type="arc" order="9"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/MergerScheduleofConsiderationPaidforAMRBDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#MergerScheduleofConsiderationPaidforAMRBDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/MergerScheduleofConsiderationPaidforAMRBDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_03b5a14d-42b5-4a40-8de1-0f65f0500ea6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_03b5a14d-42b5-4a40-8de1-0f65f0500ea6" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_3661f41e-b84b-4a92-9a70-1303187b425e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_03b5a14d-42b5-4a40-8de1-0f65f0500ea6" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_3661f41e-b84b-4a92-9a70-1303187b425e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_3661f41e-b84b-4a92-9a70-1303187b425e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_3661f41e-b84b-4a92-9a70-1303187b425e" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_3661f41e-b84b-4a92-9a70-1303187b425e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_b1830710-2255-421f-9c4e-5ab084731165" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_3661f41e-b84b-4a92-9a70-1303187b425e" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_b1830710-2255-421f-9c4e-5ab084731165" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_AmericanRiverBankARBMergerMember_09e51fbf-3aea-4cde-a495-3d388953336d" xlink:href="bmrc-20231231.xsd#bmrc_AmericanRiverBankARBMergerMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_b1830710-2255-421f-9c4e-5ab084731165" xlink:to="loc_bmrc_AmericanRiverBankARBMergerMember_09e51fbf-3aea-4cde-a495-3d388953336d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_dcf34cdf-68ca-4349-96ec-e7a82dee5e05" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfBusinessAcquisitionsByAcquisitionTable_03b5a14d-42b5-4a40-8de1-0f65f0500ea6" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_dcf34cdf-68ca-4349-96ec-e7a82dee5e05" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_dcf34cdf-68ca-4349-96ec-e7a82dee5e05_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_dcf34cdf-68ca-4349-96ec-e7a82dee5e05" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_dcf34cdf-68ca-4349-96ec-e7a82dee5e05_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_fdbe07c1-ad7b-4574-b087-6648499f50f7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityInterestIssuedOrIssuableTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableByTypeAxis_dcf34cdf-68ca-4349-96ec-e7a82dee5e05" xlink:to="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_fdbe07c1-ad7b-4574-b087-6648499f50f7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_146bad25-168b-4d87-8061-70dcea56d0ed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityInterestIssuedOrIssuableTypeDomain_fdbe07c1-ad7b-4574-b087-6648499f50f7" xlink:to="loc_us-gaap_CommonStockMember_146bad25-168b-4d87-8061-70dcea56d0ed" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferredEquityInterestsIssuedAndIssuable_c5026e31-431d-4c80-9dc7-e01d75560936" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationConsiderationTransferredEquityInterestsIssuedAndIssuable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferredEquityInterestsIssuedAndIssuable_c5026e31-431d-4c80-9dc7-e01d75560936" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BusinessCombinationConsiderationTransferredAdditionalEquityInterestsIssuedAndIssuable_f9c08e48-b4c7-47e0-84b7-e13a5640cf3b" xlink:href="bmrc-20231231.xsd#bmrc_BusinessCombinationConsiderationTransferredAdditionalEquityInterestsIssuedAndIssuable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_bmrc_BusinessCombinationConsiderationTransferredAdditionalEquityInterestsIssuedAndIssuable_f9c08e48-b4c7-47e0-84b7-e13a5640cf3b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireBusinessesGross_2430ab00-3818-4925-8175-8c1544e3affd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PaymentsToAcquireBusinessesGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_us-gaap_PaymentsToAcquireBusinessesGross_2430ab00-3818-4925-8175-8c1544e3affd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessCombinationConsiderationTransferred1_f23d100b-cb60-4148-8547-5d7ce2ad1d33" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessCombinationConsiderationTransferred1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_us-gaap_BusinessCombinationConsiderationTransferred1_f23d100b-cb60-4148-8547-5d7ce2ad1d33" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BusinessCombinationFixedExchangeRatio_4fab61c8-5853-440f-9430-de732b1a42bf" xlink:href="bmrc-20231231.xsd#bmrc_BusinessCombinationFixedExchangeRatio"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_bmrc_BusinessCombinationFixedExchangeRatio_4fab61c8-5853-440f-9430-de732b1a42bf" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionSharePrice_711243ea-5e3d-4341-9993-dd1a87ee9560" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionSharePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_1a3e10f1-aee2-4e7d-a62c-63bf3de4ee22" xlink:to="loc_us-gaap_BusinessAcquisitionSharePrice_711243ea-5e3d-4341-9993-dd1a87ee9560" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.bankofmarin.com/role/MergerScheduleofMergerRelatedOneTimeandConversionCostsDetails" xlink:type="simple" xlink:href="bmrc-20231231.xsd#MergerScheduleofMergerRelatedOneTimeandConversionCostsDetails"/>
  <link:definitionLink xlink:role="http://www.bankofmarin.com/role/MergerScheduleofMergerRelatedOneTimeandConversionCostsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveLineItems_75fdaedc-359c-42f5-9c10-0cb0c4496edc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestructuringCostAndReserveLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_a03a0fc7-a653-436a-8cae-8f3b39f7a538" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfRestructuringAndRelatedCostsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_75fdaedc-359c-42f5-9c10-0cb0c4496edc" xlink:to="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_a03a0fc7-a653-436a-8cae-8f3b39f7a538" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestructuringCostAndReserveAxis_9d826338-7408-43ce-8032-ba25042629db" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestructuringCostAndReserveAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_a03a0fc7-a653-436a-8cae-8f3b39f7a538" xlink:to="loc_us-gaap_RestructuringCostAndReserveAxis_9d826338-7408-43ce-8032-ba25042629db" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_9d826338-7408-43ce-8032-ba25042629db_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_9d826338-7408-43ce-8032-ba25042629db" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_9d826338-7408-43ce-8032-ba25042629db_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TypeOfRestructuringDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_RestructuringCostAndReserveAxis_9d826338-7408-43ce-8032-ba25042629db" xlink:to="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeSeveranceMember_74473b57-1dbb-4294-aac2-2f342751052a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeSeveranceMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:to="loc_us-gaap_EmployeeSeveranceMember_74473b57-1dbb-4294-aac2-2f342751052a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_ProfessionalServicesMember_44da329e-8b65-4e34-9d4d-daac07257d4f" xlink:href="bmrc-20231231.xsd#bmrc_ProfessionalServicesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:to="loc_bmrc_ProfessionalServicesMember_44da329e-8b65-4e34-9d4d-daac07257d4f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_DataProcessingMember_4d472114-6508-4299-9153-f164f6ceee3c" xlink:href="bmrc-20231231.xsd#bmrc_DataProcessingMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:to="loc_bmrc_DataProcessingMember_4d472114-6508-4299-9153-f164f6ceee3c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherExpenseMember_a0b63eb2-46c6-48aa-99be-049530bb6d62" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherExpenseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfRestructuringDomain_36e178c5-0984-4951-86b5-ea478f5ad96d" xlink:to="loc_us-gaap_OtherExpenseMember_a0b63eb2-46c6-48aa-99be-049530bb6d62" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAxis_a2624036-e784-4de2-a7cb-baa0413f256f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfRestructuringAndRelatedCostsTable_a03a0fc7-a653-436a-8cae-8f3b39f7a538" xlink:to="loc_us-gaap_BusinessAcquisitionAxis_a2624036-e784-4de2-a7cb-baa0413f256f" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_a2624036-e784-4de2-a7cb-baa0413f256f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_a2624036-e784-4de2-a7cb-baa0413f256f" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_a2624036-e784-4de2-a7cb-baa0413f256f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8c1bc030-4243-4971-a30f-cf7bce4b7281" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionAcquireeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_BusinessAcquisitionAxis_a2624036-e784-4de2-a7cb-baa0413f256f" xlink:to="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8c1bc030-4243-4971-a30f-cf7bce4b7281" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_bmrc_BankOfMarinMember_d5bb1bb4-3892-4cd6-a14c-dd5282367325" xlink:href="bmrc-20231231.xsd#bmrc_BankOfMarinMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionAcquireeDomain_8c1bc030-4243-4971-a30f-cf7bce4b7281" xlink:to="loc_bmrc_BankOfMarinMember_d5bb1bb4-3892-4cd6-a14c-dd5282367325" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForMergerRelatedCosts_4596dd2c-d022-4017-9d78-08f2e4ff926d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PaymentsForMergerRelatedCosts"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RestructuringCostAndReserveLineItems_75fdaedc-359c-42f5-9c10-0cb0c4496edc" xlink:to="loc_us-gaap_PaymentsForMergerRelatedCosts_4596dd2c-d022-4017-9d78-08f2e4ff926d" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="simple" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-roles-2023.xsd#eedm"/>
  <link:definitionLink xlink:role="http://fasb.org/us-gaap/role/eedm/ExtensibleEnumerationLists" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AssetsAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestReceivableAndOtherAssets" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestReceivableAndOtherAssets"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract" xlink:to="loc_us-gaap_InterestReceivableAndOtherAssets" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentAndFinanceLeaseRightOfUseAssetAfterAccumulatedDepreciationAndAmortization" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAbstract" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LiabilitiesAbstract"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtAndCapitalLeaseObligations" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtAndCapitalLeaseObligations"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract" xlink:to="loc_us-gaap_DebtAndCapitalLeaseObligations" xlink:type="arc" order="1"/>
  </link:definitionLink>
</link:linkbase>
